Frontend: EditorKeyboard crash on document.activeElement = null #116

Closed
opened 2026-05-26 18:20:47 -04:00 by zgaetano · 1 comment
Owner

Fixed in 04ce096. EditorKeyboard now does (document.activeElement && document.activeElement.tagName) || '' so iframe focus, popovers, and devtools-driven focus loss no longer crash the handler.

Fixed in 04ce096. `EditorKeyboard` now does `(document.activeElement && document.activeElement.tagName) || ''` so iframe focus, popovers, and devtools-driven focus loss no longer crash the handler.
Author
Owner

Fix Plan — #116 EditorKeyboard crash on document.activeElement = null

Root cause: screens-editor.jsx:711 reads document.activeElement.tagName without null guard. document.activeElement is null in iframes after focus loss → TypeError nukes editor keyboard input.

Fix — one line:

// before:
const tag = document.activeElement.tagName;

// after:
const tag = document.activeElement?.tagName;

Files: screens-editor.jsx:711
Effort: 5min
**Priority: P1 — crash fix

## Fix Plan — #116 EditorKeyboard crash on document.activeElement = null **Root cause:** `screens-editor.jsx:711` reads `document.activeElement.tagName` without null guard. `document.activeElement` is null in iframes after focus loss → TypeError nukes editor keyboard input. **Fix — one line:** ```js // before: const tag = document.activeElement.tagName; // after: const tag = document.activeElement?.tagName; ``` **Files:** `screens-editor.jsx:711` **Effort:** 5min **Priority: P1 — crash fix
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#116
No description provided.