Skip to content

Commit 74991ae

Browse files
powerfulyangpowerfulyang
powerfulyang
authored and
powerfulyang
committed
fix: event.key is undefined #1887
1 parent bae117c commit 74991ae

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ dist/
1515

1616
# IDE
1717
.vscode/
18+
.idea
1819

1920
# Environment files
2021
.env
2122

2223
# Cypress Video and Screenshots output
2324
cypress/screenshots/
24-
cypress/videos/
25+
cypress/videos/

packages/docsearch-react/src/useDocSearchKeyboardEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function useDocSearchKeyboardEvents({
3939
if (
4040
(event.keyCode === 27 && isOpen) ||
4141
// The `Cmd+K` shortcut both opens and closes the modal.
42-
(event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) ||
42+
(event.key?.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) ||
4343
// The `/` shortcut opens but doesn't close the modal because it's
4444
// a character.
4545
(!isEditingContent(event) && event.key === '/' && !isOpen)

0 commit comments

Comments
 (0)