fix: fix command+k hotkey on macOS devices (#178)

This commit is contained in:
sengoku-f
2025-03-24 21:06:41 +08:00
committed by GitHub
parent ee07a33a44
commit ce30ebec67
2 changed files with 8 additions and 2 deletions

5
.changes/macos-meta.md Normal file
View File

@@ -0,0 +1,5 @@
---
"meilisearch-docsearch": "patch"
---
Fix <kbd>Command</kbd>+<kbd>k</kbd> not working on macOS devices.

View File

@@ -58,8 +58,9 @@ export function useDocSearchHotKeys({
modsAndkeys.some(isCtrl);
const shift = event.shiftKey == modsAndkeys.includes("shift");
const alt = event.altKey == modsAndkeys.some(isAlt);
const meta =
!isAppleDevice() && event.metaKey == modsAndkeys.some(isMeta);
const meta = isAppleDevice()
? true
: event.metaKey == modsAndkeys.some(isMeta);
return ctrl && shift && alt && meta;
}