diff --git a/.changeset/many-cows-add.md b/.changeset/many-cows-add.md new file mode 100644 index 000000000..4e6e537d0 --- /dev/null +++ b/.changeset/many-cows-add.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +Update hotkeys util to use isHotkey for better support for non-latin keyboards diff --git a/packages/slate-react/src/utils/hotkeys.ts b/packages/slate-react/src/utils/hotkeys.ts index 65de16d68..c4efaeb47 100644 --- a/packages/slate-react/src/utils/hotkeys.ts +++ b/packages/slate-react/src/utils/hotkeys.ts @@ -1,4 +1,4 @@ -import { isKeyHotkey } from 'is-hotkey' +import { isHotkey } from 'is-hotkey' import { IS_APPLE } from './environment' /** @@ -53,9 +53,9 @@ const create = (key: string) => { const generic = HOTKEYS[key] const apple = APPLE_HOTKEYS[key] const windows = WINDOWS_HOTKEYS[key] - const isGeneric = generic && isKeyHotkey(generic) - const isApple = apple && isKeyHotkey(apple) - const isWindows = windows && isKeyHotkey(windows) + const isGeneric = generic && isHotkey(generic) + const isApple = apple && isHotkey(apple) + const isWindows = windows && isHotkey(windows) return (event: KeyboardEvent) => { if (isGeneric && isGeneric(event)) return true