diff --git a/js/app.js b/js/app.js index 840618c..bf23858 100644 --- a/js/app.js +++ b/js/app.js @@ -3996,11 +3996,13 @@ async function openSlideOver(id, opts) { : document.getElementById('soSite'); if (f) f.focus(); }, 50); - } else { + } else if (!opts.noFocus) { // Edit mode: focus the Title input so the user can start editing // immediately (especially when opened via Enter from j/k nav). // Defer so the slideover transition finishes first — otherwise // the browser may steal focus back during the animation. + // Skipped on the post-save re-open (opts.noFocus) — grabbing + + // selecting the title right after Save is jarring. setTimeout(() => { const f = document.getElementById('soTitle'); if (f) { f.focus(); f.select(); } @@ -4844,7 +4846,9 @@ async function soSave() { // leave soState at id=null, causing a second Save to POST again // and create a duplicate. soState = null; - if (updated) openSlideOver(updated.id); + // noFocus: keep the slideover open on the saved entry WITHOUT grabbing + // + selecting the title (jarring right after Save). + if (updated) openSlideOver(updated.id, { noFocus: true }); else closeSlideOver(); render(); if (isNew && targetId) {