Skip to content

Commit

Permalink
Inspector should be toggled only on alt+f12.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Jul 29, 2020
1 parent af16a9d commit 93ecbee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui.js
Expand Up @@ -180,5 +180,5 @@ function updateBodyHeight( height ) {
}

function isToggleShortcut( event ) {
return event.altKey && event.key === 'F12';
return event.altKey && !event.shiftKey && !event.ctrlKey && event.key === 'F12';
}
12 changes: 12 additions & 0 deletions tests/inspector/ui.js
Expand Up @@ -360,6 +360,18 @@ describe( '<InspectorUI />', () => {
type: TOGGLE_IS_COLLAPSED
} );
} );

it( 'should not toggle the UI on a global SHIFT+ALT+F12 keyboard shortcut', () => {
windowEventMap.keydown( { key: 'F12', altKey: true, shiftKey: true } );

sinon.assert.notCalled( dispatchSpy );
} );

it( 'should not toggle the UI on a global CTRL+ALT+F12 keyboard shortcut', () => {
windowEventMap.keydown( { key: 'F12', altKey: true, ctrlKey: true } );

sinon.assert.notCalled( dispatchSpy );
} );
} );
} );

Expand Down

0 comments on commit 93ecbee

Please sign in to comment.