╭ changed ──────────╮ │src/embed/script.js│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │189 document.addEventListener("focusin", (event) => { │ │190 const t = event.target; │ │191 if (!t || !t.dataset || !t.dataset.focusId) return; │ │192 - wasmInstance.exports._onMouseClick(Number(t.dataset.focusId)); │ │193 - wasmInstance.exports._tick(minRows(), maxCols()); │ │192 + // sync the wasm focus to wherever the browser moved focus │ │193 + wasmInstance.exports._setFocus(Number(t.dataset.focusId)); │ │194 + // a click's mousedown fires this focusin before the click event. ticking│ │195 + // here would rebuild #grid and destroy the node before its click lands, │ │196 + // swallowing the navigation and forcing a second click — so don't │ │197 + // re-render for a grid element. overlay controls live outside #grid and │ │198 + // survive the diff, so they still tick. │ │199 + if (!grid.contains(t)) wasmInstance.exports._tick(minRows(), maxCols()); │ │200 }); │ │201 │ │202 grid.addEventListener("click", (event) => { │ ╰──────────────────────────────────────────────────────────────────────────────────────╯