aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authornai-degen <92774204+nai-degen@users.noreply.github.com>2022-10-09 19:37:35 -0500
committerAUTOMATIC1111 <16777216c@gmail.com>2022-10-11 21:19:30 +0300
commit9e5f6b558072f6cdfa0f7010fa819662952fcaf1 (patch)
treefd39566dcc0ea2549cf3cdcd034dd85958b21c75 /javascript
parentd7474a5185df2af84a93a12bc7e140d24e0fc516 (diff)
triggers 'input' event when using arrow keys to edit attention
Diffstat (limited to 'javascript')
-rw-r--r--javascript/edit-attention.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/javascript/edit-attention.js b/javascript/edit-attention.js
index 0280c603..79566a2e 100644
--- a/javascript/edit-attention.js
+++ b/javascript/edit-attention.js
@@ -38,4 +38,7 @@ addEventListener('keydown', (event) => {
target.selectionStart = selectionStart;
target.selectionEnd = selectionEnd;
}
+ // 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.
+ target.dispatchEvent(new Event("input", { bubbles: true }));
});