fix(health): Fix keeps focus on the password field

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 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-25 16:40:30 +01:00
parent 0184fc7cc2
commit 47689f693c
+4 -1
View File
@@ -96,7 +96,10 @@ async function openEntryForFix(entryId) {
// Bail if the editor didn't actually switch (user cancelled the discard // Bail if the editor didn't actually switch (user cancelled the discard
// prompt): the steps below would unmask + select the password of whatever // prompt): the steps below would unmask + select the password of whatever
// entry is still open, and pulse Generate on it — the wrong entry. // 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'); const pwd = document.getElementById('soPassword');
if (pwd) { if (pwd) {
pwd.type = 'text'; // unmask so the user sees what they're replacing pwd.type = 'text'; // unmask so the user sees what they're replacing