fix(keyboard): let browser-native shortcuts pass through handlers #158
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
track:api
track:auto
track:core
track:deploy
track:infra
track:ui
v0.1.0
v0.1.1
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/delta!158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/browser-shortcut-passthrough"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Delta's keyboard handlers intercept browser-native shortcuts like
Ctrl+-(zoom out),Ctrl+T(new tab),Ctrl+W(close tab), and others. The root cause is that handlers checke.keywithout modifier guards -- for example, pressingCtrl+-matchese.key === "-"inglobal-keyboard.tsxand toggles the sidebar instead of zooming out.Solution
Add a centralized
isBrowserShortcut()utility insrc/lib/utils.tsthat detects browser-native key combinations (zoom, tab/window management, address bar, reload, find, print, devtools, F-keys, andAlt+Arrowfor browser back/forward). Guard all fivewindow.addEventListener("keydown")handlers with an early return when a browser shortcut is detected.Closes #154