Skip to content

Commit d2cba92

Browse files
neortheltigerchino
andauthored
fix: avoid activating search box when cmd + shift + k is pressed (#1380)
* Only focus search when no shiftKey When using Ctrl/Cmd+Shift+k in repl/tutorial you expect the current line to be removed, instead search in the nav-bar is focused. This change should fix that. * format --------- Co-authored-by: Tee Ming <[email protected]> Co-authored-by: Chew Tee Ming <[email protected]>
1 parent b06b94f commit d2cba92

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/site-kit/src/lib/search/SearchBox.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ It appears when the user clicks on the `Search` component or presses the corresp
127127

128128
<svelte:window
129129
onkeydown={(e) => {
130-
if (e.key === 'k' && (navigator.platform === 'MacIntel' ? e.metaKey : e.ctrlKey)) {
130+
if (
131+
e.key === 'k' &&
132+
!e.shiftKey &&
133+
(navigator.platform === 'MacIntel' ? e.metaKey : e.ctrlKey)
134+
) {
131135
e.preventDefault();
132136
search.query = '';
133137

0 commit comments

Comments
 (0)