Skip to content

Commit

Permalink
FirenvimElement.ts: use ctrlkey to trigger update events on textarea
Browse files Browse the repository at this point in the history
Closes #1359
  • Loading branch information
glacambre committed May 25, 2024
1 parent fc72687 commit 4e98da8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/FirenvimElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,12 @@ export class FirenvimElement {
const focused = this.isFocused();
this.editor.setContent(text);
[
new Event("keydown", { bubbles: true }),
new Event("keyup", { bubbles: true }),
new Event("keypress", { bubbles: true }),
new Event("beforeinput", { bubbles: true }),
new Event("input", { bubbles: true }),
new Event("change", { bubbles: true })
new KeyboardEvent("keydown", { bubbles: true, ctrlKey: true }),
new KeyboardEvent("keyup", { bubbles: true, ctrlKey: true }),
new KeyboardEvent("keypress", { bubbles: true, ctrlKey: true }),
new Event("beforeinput", { bubbles: true }),
new Event("input", { bubbles: true }),
new Event("change", { bubbles: true }),
].forEach(ev => this.originalElement.dispatchEvent(ev));
if (focused) {
this.focus();
Expand Down

0 comments on commit 4e98da8

Please sign in to comment.