diff options
| author | Shulhan <ms@kilabit.info> | 2023-12-08 08:42:31 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-12-08 08:42:31 +0700 |
| commit | 6f86c0ee8f1a77cc3a1b481368db2f80b923a3a8 (patch) | |
| tree | 7889d56262b86e59f887e17ea27eb367c8b645f9 | |
| parent | 20bbe3f3a52e5f38a9d557dfbfd04beb2935188f (diff) | |
| download | pakakeh.ts-6f86c0ee8f1a77cc3a1b481368db2f80b923a3a8.tar.xz | |
editor: set key control to false on blur
Sometimes we got an issue where pressing enter may cause the editor
being saved without pressing Control key.
| -rw-r--r-- | editor/editor.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/editor.ts b/editor/editor.ts index 5b721a1..9cd4988 100644 --- a/editor/editor.ts +++ b/editor/editor.ts @@ -131,6 +131,9 @@ export class WuiEditor { this.elContent.onkeyup = (ev: KeyboardEvent) => { this.onKeyupDocument(this, ev); }; + this.elContent.addEventListener("blur", () => { + this.isKeyControl = false; + }); } this.elContent.classList.add(WUI_EDITOR_CLASS_CONTENT); this.el.appendChild(this.elContent); |
