mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 02:03:59 +02:00
update hotkeys util to use isHotkey (#5462)
This commit is contained in:
5
.changeset/many-cows-add.md
Normal file
5
.changeset/many-cows-add.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
---
|
||||
|
||||
Update hotkeys util to use isHotkey for better support for non-latin keyboards
|
@@ -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
|
||||
|
Reference in New Issue
Block a user