From 47689f693cc236e7de1ab9e419ac48eb38051baa Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Sat, 25 Jul 2026 16:40:30 +0100 Subject: [PATCH] fix(health): Fix keeps focus on the password field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openSlideOver defers a focus+select on the title (setTimeout 80ms), which landed after openEntryForFix's own focus and yanked the caret out of the password field a moment after Fix was clicked. Pass the existing { noFocus: true } option — added for the post-save re-open, exactly the same need: the caller owns the focus. Co-Authored-By: Claude Opus 4.8 --- js/app.health.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/app.health.js b/js/app.health.js index 8b15198..6116de2 100644 --- a/js/app.health.js +++ b/js/app.health.js @@ -96,7 +96,10 @@ async function openEntryForFix(entryId) { // Bail if the editor didn't actually switch (user cancelled the discard // prompt): the steps below would unmask + select the password of whatever // entry is still open, and pulse Generate on it — the wrong entry. - if (!(await openSlideOver(entryId))) return; + // noFocus: openSlideOver otherwise defers a focus+select on the title + // (setTimeout 80ms) which lands AFTER the password focus below and steals + // it back. Fix targets the password — it owns the focus here. + if (!(await openSlideOver(entryId, { noFocus: true }))) return; const pwd = document.getElementById('soPassword'); if (pwd) { pwd.type = 'text'; // unmask so the user sees what they're replacing