From 3a731557d09232dbf6871a33cff2cbeda42db880 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 27 Jan 2022 00:36:25 -0800 Subject: [PATCH 1/1] Don't select-all the task description when beginning editing I find that * most edits are more gentle than complete replacement * I consistently reach for the "end" key to begin editing * If I want complete replacement, ^A is easier to type than "end" --- vopamoi.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vopamoi.ts b/vopamoi.ts index 7bdf4b8..01e761c 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -49,12 +49,11 @@ const Model = { const input = target.children[0] as HTMLInputElement; if ( input.value === target.getAttribute("data-description") && - input.selectionStart === 0 && + input.selectionStart === input.value.length && input.selectionEnd === input.value.length ) { // No local changes have actually been made yet. Change the contents of the edit box! input.value = newDescription; - input.select(); } else { // No great options. // Prefer not to interrupt the local user's edit. @@ -215,7 +214,6 @@ function BrowserUI() { task.textContent = ""; task.appendChild(input); input.focus(); - input.select(); event.preventDefault(); }, -- 2.44.1