File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 2727
2828 const storeMethods = createStoreMethods ();
2929 const actionMap = createActionMap (commands );
30- let formattedEscKey = ' '
30+ let formattedEscKey = ' ' ;
3131 const { togglePalette, closePalette : closeCommandPalette } = storeMethods ;
3232
3333 const updateStore = () => {
107107 }
108108 };
109109
110+ const toggleCommandPalette = (event : KeyboardEvent ) => {
111+ event .preventDefault ();
112+ togglePalette ();
113+ };
114+
110115 onMount (async () => {
111- const tinyKeys = await import (' tinykeys' )
112- const {default : tiny, parseKeybinding} = tinyKeys
116+ const tinyKeys = await import (' tinykeys' );
117+ const { default : tiny, parseKeybinding } = tinyKeys ;
113118 formattedEscKey = parseKeybinding (' Esc' ).flat ().join (' ' );
114119 const shortcuts = createShortcuts ({
115120 actions: commands
116121 });
117122 unsubscribeKbdListener = tiny (window , {
118123 ... shortcuts ,
119- ' $mod+k' : togglePalette ,
124+ ' $mod+k' : toggleCommandPalette ,
120125 Escape: closePalette ,
121126 ArrowUp: handleArrowUp ,
122127 ArrowDown: handleArrowDown ,
161166 focusLastElement ();
162167 wrapperElement ?.removeEventListener ?.(' click' , handleOutsideClick );
163168 });
164-
165-
166169 </script >
167170
168171<Portal target =" body" >
You can’t perform that action at this time.
0 commit comments