aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-12-08 08:42:31 +0700
committerShulhan <ms@kilabit.info>2023-12-08 08:42:31 +0700
commit6f86c0ee8f1a77cc3a1b481368db2f80b923a3a8 (patch)
tree7889d56262b86e59f887e17ea27eb367c8b645f9
parent20bbe3f3a52e5f38a9d557dfbfd04beb2935188f (diff)
downloadpakakeh.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.ts3
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);