fix: browser shortcuts intercepted by keyboard handlers #154

Closed
opened 2026-03-29 05:16:09 +00:00 by barrettruth · 0 comments
barrettruth commented 2026-03-29 05:16:09 +00:00

Problem

Delta's keyboard handlers intercept browser-native shortcuts like Ctrl+- (zoom out), Ctrl+= (zoom in), Ctrl+0 (reset zoom), Ctrl+T (new tab), Ctrl+W (close tab), etc. For example, pressing Ctrl+- toggles the sidebar instead of zooming out because the - key handler in global-keyboard.tsx has no ctrlKey guard.

Solution

Add a centralized isBrowserShortcut() utility that detects browser-native key combinations (zoom, tab management, navigation, devtools, reload). Guard every window.addEventListener("keydown", ...) handler in the codebase with an early return when a browser shortcut is detected.

## Problem Delta's keyboard handlers intercept browser-native shortcuts like `Ctrl+-` (zoom out), `Ctrl+=` (zoom in), `Ctrl+0` (reset zoom), `Ctrl+T` (new tab), `Ctrl+W` (close tab), etc. For example, pressing `Ctrl+-` toggles the sidebar instead of zooming out because the `-` key handler in `global-keyboard.tsx` has no `ctrlKey` guard. ## Solution Add a centralized `isBrowserShortcut()` utility that detects browser-native key combinations (zoom, tab management, navigation, devtools, reload). Guard every `window.addEventListener("keydown", ...)` handler in the codebase with an early return when a browser shortcut is detected.
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
barrettruth/delta#154
No description provided.