mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
fix: prevent triggering Dead key in macOS
This commit is contained in:
@@ -216,6 +216,14 @@ export function keydownHandler (e: KeyboardEvent) {
|
||||
continue
|
||||
}
|
||||
|
||||
// if user press `Option + E` in macOS, the `Dead` key will be triggered and insert `´`. so we need to blur and focus the input element to prevent this.s
|
||||
if (isMacOS && e.key === 'Dead' && e.target && 'focus' in e.target && 'blur' in e.target) {
|
||||
(e.target as any).blur()
|
||||
setTimeout(() => {
|
||||
(e.target as any).focus()
|
||||
}, 0)
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
getActionHandler(item.name)()
|
||||
|
||||
Reference in New Issue
Block a user