╭ changed ──────────╮ │src/embed/script.js│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │243 const tag = document.activeElement.tagName; │ │244 const isArrow = event.key === "ArrowUp" || event.key === "ArrowDown" ||│ │245 event.key === "ArrowLeft" || event.key === "ArrowRight"; │ │246 + if (tag === "INPUT" && document.activeElement.readOnly && │ │247 + ["Enter", "ArrowLeft", "ArrowRight"].includes(event.key)) { │ │248 + event.preventDefault(); │ │249 + if (event.key === "Enter") { │ │250 + document.activeElement.select(); │ │251 + return; │ │252 + } │ │253 + wasmInstance.exports._onKeyDown(event.keyCode); │ │254 + wasmInstance.exports._tick(minRows(), maxCols()); │ │255 + return; │ │256 + } │ │257 if (tag === "INPUT" && event.key === "Enter") { │ │258 // enter in a text input never submits the form; only the │ │259 // submit button does │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │308 const t = event.target; │ │309 if (!t || (t.tagName !== "INPUT" && t.tagName !== "TEXTAREA") || !t.dataset.focusId) return;│ │310 sendTextInputValue(Number(t.dataset.focusId), t.value); │ │311 + }); │ │312 + │ │313 + document.addEventListener("click", (event) => { │ │314 + const t = event.target; │ │315 + if (t && t.tagName === "INPUT" && t.readOnly) t.select(); │ │316 }); │ │317 │ │318 document.addEventListener("focusin", (event) => { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯