From: Scott Worley Date: Thu, 27 Jan 2022 06:17:43 +0000 (-0800) Subject: Explicitly remove the completeEdit onblur event listener X-Git-Url: http://git.scottworley.com/vopamoi/commitdiff_plain/8ca3cda9da4db4ac0bd05462b54e04fabbf75451?ds=inline 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. --- 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();