From c3d7edc4591223ba111550a737cbd3dea82b3f01 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 18 Sep 2026 10:59:44 +0800 Subject: [PATCH] fix(#8): focus first composer field when opening from empty state When opening the composer from the empty state / Add button, focus the first field. --- extension/popup/popup.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extension/popup/popup.js b/extension/popup/popup.js index fefc495..31eb9de 100644 --- a/extension/popup/popup.js +++ b/extension/popup/popup.js @@ -237,6 +237,8 @@ function openComposer(type = 'bookmark') { setComposerType(type); fillCollectionSelect(); addForm.scrollIntoView({ block: 'nearest' }); + const focusEl = type === 'collection' ? addForm.elements.name : addForm.elements.title; + focusEl?.focus(); } function openCollectionComposer() { @@ -245,6 +247,7 @@ function openCollectionComposer() { collectionAddForm.hidden = false; collectionAddForm.reset(); collectionAddForm.scrollIntoView({ block: 'nearest' }); + collectionAddForm.elements.title?.focus(); } function hideComposer() {