mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 22:21:20 +02:00
Avoid executing hotkeys while composing (#1357)
This commit is contained in:
committed by
Ian Storm Taylor
parent
1b4532a9aa
commit
0d7fccc91c
@@ -371,11 +371,11 @@ function BeforePlugin() {
|
|||||||
function onKeyDown(event, change, editor) {
|
function onKeyDown(event, change, editor) {
|
||||||
if (editor.props.readOnly) return true
|
if (editor.props.readOnly) return true
|
||||||
|
|
||||||
// When composing, these characters commit the composition but also move the
|
// When composing, we need to prevent all hotkeys from executing while
|
||||||
// selection before we're able to handle it, so prevent their default,
|
// typing. However, certain characters also move the selection before
|
||||||
// selection-moving behavior.
|
// we're able to handle it, so prevent their default behavior.
|
||||||
if (isComposing && HOTKEYS.COMPOSING(event)) {
|
if (isComposing) {
|
||||||
event.preventDefault()
|
if (HOTKEYS.COMPOSING(event)) event.preventDefault()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user