From 8ca3cda9da4db4ac0bd05462b54e04fabbf75451 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Wed, 26 Jan 2022 22:17:43 -0800 Subject: [PATCH] Explicitly remove the completeEdit onblur event listener When the completeEdit is invoked by keystroke, we don't want it invoked a second time as a result of its own action removing the input field. Firefox does *not* call the "blur" event when a focused input element is removed. Chromium *does* call the "blur" event when a focused input element is removed. So this is needed for Chromium. --- vopamoi.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vopamoi.ts b/vopamoi.ts index 151a9e4..04c5d41 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -199,6 +199,7 @@ const BrowserUI = { const task = input.parentElement!; const oldDescription = task.getAttribute("data-description")!; const newDescription = input.value; + input.removeEventListener("blur", BrowserUI.completeEdit); task.removeChild(task.children[0]); task.removeAttribute("data-description"); task.focus(); -- 2.44.1