mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-01 06:40:57 -08:00
update sending input event in java script to not cause exception in browser https://github.com/gradio-app/gradio/issues/2981
This commit is contained in:
parent
aede265f1d
commit
38b7186e6e
3 changed files with 11 additions and 4 deletions
|
|
@ -278,3 +278,11 @@ function restart_reload(){
|
|||
|
||||
return []
|
||||
}
|
||||
|
||||
// Simulate an `input` DOM event for Gradio Textbox component. Needed after you edit its contents in javascript, otherwise your edits
|
||||
// will only visible on web page and not sent to python.
|
||||
function updateInput(target){
|
||||
let e = new Event("input", { bubbles: true })
|
||||
Object.defineProperty(e, "target", {value: target})
|
||||
target.dispatchEvent(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue