File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,12 @@ import type { ReactNode } from 'react'
1010import { Link , Outlet } from 'react-router'
1111
1212import { useIsActivePath } from '~/hooks/use-is-active-path'
13- import { KEYS } from '~/ui/util/keys'
13+ import { hasModifier , KEYS } from '~/ui/util/keys'
1414
1515const selectTab = ( e : React . KeyboardEvent < HTMLDivElement > ) => {
16+ // Don't intercept modified arrow keys (Cmd for browser back/forward, etc.)
17+ if ( hasModifier ( e ) ) return
18+
1619 const target = e . target as HTMLDivElement
1720 if ( e . key === KEYS . left ) {
1821 e . stopPropagation ( )
Original file line number Diff line number Diff line change @@ -21,3 +21,8 @@ export const KEYS = {
2121 space : ' ' ,
2222 escape : 'Escape' ,
2323} as const
24+
25+ /** Returns true if any modifier key is held */
26+ export const hasModifier = (
27+ e : Pick < KeyboardEvent , 'metaKey' | 'ctrlKey' | 'shiftKey' | 'altKey' >
28+ ) => e . metaKey || e . ctrlKey || e . shiftKey || e . altKey
You can’t perform that action at this time.
0 commit comments