fix(hub): keep only text fields focused across inbox redraws
🧪 Test / 🧪 Lock + lint (push) Waiting to run
🧪 Test / 🧪 Lock + lint (push) Waiting to run
keepTyping() held any focused input with an aria-label, so a checkbox the operator just ticked in the inbox went through setSelectionRange after the redraw. Chromium and Firefox throw InvalidStateError there and the rest of drawInbox() never ran. Only fields with a text selection are held now. 🎯 Fix: 95 % 💥 Break: 2 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 93 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0f71fba0a4
commit
7505fcb55d
1 file changed
+1
-1
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
function keepTyping(root, draw) {
|
||||
const field = document.activeElement;
|
||||
const held = field && field.tagName === "INPUT" && root.contains(field) && field.getAttribute("aria-label") ? [field.getAttribute("aria-label"), field.selectionStart, field.selectionEnd] : null;
|
||||
const held = field && field.tagName === "INPUT" && typeof field.selectionStart === "number" && root.contains(field) && field.getAttribute("aria-label") ? [field.getAttribute("aria-label"), field.selectionStart, field.selectionEnd] : null;
|
||||
draw();
|
||||
const again = held && [...root.querySelectorAll("input")].find((node) => node.getAttribute("aria-label") === held[0]);
|
||||
if (again && document.activeElement !== again) {
|
||||
|
||||
Reference in new issue
Block a user