Skip to content

Commit

Permalink
Update packages/docsearch-react/src/useDocSearchKeyboardEvents.ts
Browse files Browse the repository at this point in the history
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
  • Loading branch information
非凡少年 and francoischalifour authored May 16, 2023
1 parent db686ba commit e4bce7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/docsearch-react/src/useDocSearchKeyboardEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export function useDocSearchKeyboardEvents({
if (
(event.keyCode === 27 && isOpen) ||
// The `Cmd+K` shortcut both opens and closes the modal.
// We need to check for `event.key` because it can be `undefined` with
// Chrome's autofill feature.
// See https://github.com/paperjs/paper.js/issues/1398
(event.key?.toLowerCase() === 'k' &&
(event.metaKey || event.ctrlKey)) ||
// The `/` shortcut opens but doesn't close the modal because it's
Expand Down

0 comments on commit e4bce7e

Please sign in to comment.