Compare commits

..

3 Commits
1.2.1 ... 1.2.2

Author SHA1 Message Date
Dominik Reh
4de62638b3 Merge pull request #3 from HalfMAI/fix_input_event 2022-10-13 08:06:22 +02:00
Halfmai
d99bfb7c48 formatting 2022-10-13 11:52:06 +08:00
Halfmai
61e74154b6 fix missing dispatch event to gradio 2022-10-13 11:44:17 +08:00

View File

@@ -182,6 +182,10 @@ function insertTextAtCursor(text, tagword) {
prompt = promptTextbox.value;
promptTextbox.selectionEnd = promptTextbox.selectionStart;
// Since we've modified a Gradio Textbox component manually, we need to simulate an `input` DOM event to ensure its
// internal Svelte data binding remains in sync.
promptTextbox.dispatchEvent(new Event("input", { bubbles: true }));
// Hide results after inserting
hideResults();