File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
src/frontend/apps/impress/src
features/left-panel/components Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,15 @@ export const LeftPanelHeader = ({ children }: PropsWithChildren) => {
1515 const router = useRouter ( ) ;
1616 const searchModal = useModal ( ) ;
1717 const { authenticated } = useAuth ( ) ;
18- useCmdK ( searchModal . open ) ;
18+ useCmdK ( ( ) => {
19+ const isEditorToolbarOpen =
20+ document . getElementsByClassName ( 'bn-formatting-toolbar' ) . length > 0 ;
21+ if ( isEditorToolbarOpen ) {
22+ return ;
23+ }
24+
25+ searchModal . open ( ) ;
26+ } ) ;
1927 const { togglePanel } = useLeftPanelStore ( ) ;
2028
2129 const { mutate : createDoc } = useCreateDoc ( {
Original file line number Diff line number Diff line change @@ -6,12 +6,6 @@ export const useCmdK = (callback: () => void) => {
66 if ( ( e . key === 'k' || e . key === 'K' ) && ( e . metaKey || e . ctrlKey ) ) {
77 e . preventDefault ( ) ;
88
9- const isProseMirrorFocused =
10- document . activeElement ?. classList . contains ( 'ProseMirror' ) ;
11- if ( isProseMirrorFocused ) {
12- return ;
13- }
14-
159 callback ( ) ;
1610 }
1711 } ;
You can’t perform that action at this time.
0 commit comments