File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,10 @@ function useSearchKeyboardShortcuts(store: SidebarStore) {
3434
3535 const modifierKey = isMacOS ( ) ? 'meta' : 'ctrl' ;
3636
37+ // When user is in an input field, respond to CMD-/CTRL-K keypresses,
38+ // but ignore '/' keypresses
3739 useShortcut ( shortcuts . openSearch , openSearch , { ignoreWhenEditable : true } ) ;
38- useShortcut ( `${ modifierKey } +k` , openSearch , { ignoreWhenEditable : true } ) ;
40+ useShortcut ( `${ modifierKey } +k` , openSearch , { ignoreWhenEditable : false } ) ;
3941}
4042
4143export default function SearchIconButton ( ) {
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ describe('SearchIconButton', () => {
199199 } ) ;
200200 } ) ;
201201
202- it ( 'does not open search panel if user is in an input field and presses "Ctrl-k"' , ( ) => {
202+ it ( 'opens search panel if user is in an input field and presses "Ctrl-k"' , ( ) => {
203203 fakeIsMacOS . returns ( false ) ;
204204 const input = document . createElement ( 'input' ) ;
205205 document . body . append ( input ) ;
@@ -220,7 +220,7 @@ describe('SearchIconButton', () => {
220220 } ) ,
221221 ) ;
222222
223- assert . notCalled ( fakeStore . openSidebarPanel ) ;
223+ assert . calledWith ( fakeStore . openSidebarPanel , 'searchAnnotations' ) ;
224224 } finally {
225225 input . remove ( ) ;
226226 }
You can’t perform that action at this time.
0 commit comments