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 <chewteeming01@gmail.com> Co-authored-by: Chew Tee Ming <chew.tee.ming@nindatech.com>
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy