triggers 'input' event when using arrow keys to edit attention

This commit is contained in:
nai-degen 2022-10-09 19:37:35 -05:00 committed by AUTOMATIC1111
parent d7474a5185
commit 9e5f6b5580
1 changed files with 3 additions and 0 deletions

View File

@ -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 }));
});