1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-19 13:41:19 +02:00

Avoid executing hotkeys while composing (#1357)

This commit is contained in:
Blake Embrey
2017-10-31 19:01:13 -07:00
committed by Ian Storm Taylor
parent 1b4532a9aa
commit 0d7fccc91c

View File

@@ -371,11 +371,11 @@ function BeforePlugin() {
function onKeyDown(event, change, editor) {
if (editor.props.readOnly) return true
// When composing, these characters commit the composition but also move the
// selection before we're able to handle it, so prevent their default,
// selection-moving behavior.
if (isComposing && HOTKEYS.COMPOSING(event)) {
event.preventDefault()
// When composing, we need to prevent all hotkeys from executing while
// typing. However, certain characters also move the selection before
// we're able to handle it, so prevent their default behavior.
if (isComposing) {
if (HOTKEYS.COMPOSING(event)) event.preventDefault()
return true
}