File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,8 +39,20 @@ export default function CustomizePage(): ReactElement {
3939 } ;
4040 } , [ ] ) ;
4141
42- // Clear custom hex overrides when switching to auto — fixed colors
43- // conflict with the dual-palette prefers-color-scheme switching.
42+ useEffect ( ( ) => {
43+ const handleKeyDown = ( event : KeyboardEvent ) => {
44+ if ( ( event . ctrlKey || event . metaKey ) && event . key . toLowerCase ( ) === 'k' ) {
45+ const input = document . querySelector < HTMLInputElement > ( '#username-input' ) ;
46+ if ( ! input || document . activeElement === input ) return ;
47+ event . preventDefault ( ) ;
48+ input . focus ( ) ;
49+ }
50+ } ;
51+
52+ window . addEventListener ( 'keydown' , handleKeyDown ) ;
53+ return ( ) => window . removeEventListener ( 'keydown' , handleKeyDown ) ;
54+ } , [ ] ) ;
55+
4456 // Clear custom hex overrides when switching to virtual themes because
4557 // fixed colors conflict with their palette-selection behavior.
4658 const handleThemeChange = useCallback ( ( newTheme : string ) : void => {
You can’t perform that action at this time.
0 commit comments