From 547551d89a1dcac9a8f941e3f976bb59ffc55b39 Mon Sep 17 00:00:00 2001 From: Lalit Maganti Date: Fri, 13 Dec 2024 14:38:29 +0000 Subject: [PATCH] ui: don't move focus to notes input when created This is a tricky UX decision because you could argue you want this. However, IMO most of the time people create a note to mark that time point, not because they actually want to annotate it. By moving focus, we also make it much harder to actually delete the note as you need to click the note *twice* to be able to delete it (once to select, once to remove focus from text box). Making the focus explicit makes this much more obvious to the user that the focus is on the box so other hotkeys will not work: tbh I did not even notice that the focus was being stolen for several minutes while debugging this issue. Change-Id: I01ae9318b59b166ddd7d7c244d0c287d25f6857f Bug: https://github.com/google/perfetto/issues/965 --- ui/src/frontend/notes_panel.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/src/frontend/notes_panel.ts b/ui/src/frontend/notes_panel.ts index 60a5be49a5..d7e5ba5330 100644 --- a/ui/src/frontend/notes_panel.ts +++ b/ui/src/frontend/notes_panel.ts @@ -405,7 +405,6 @@ export class NotesEditorTab implements DetailsPanel { // value as we move the mouse. const inputElement = v.dom as HTMLInputElement; inputElement.value = note.text; - inputElement.focus(); }, onchange: (e: InputEvent) => { const newText = (e.target as HTMLInputElement).value;