From 1d140e70fb87b73c51eb99553a2b53f016c9a2ee Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Mon, 16 Oct 2017 19:56:28 -0700 Subject: [PATCH] fix missing return true for before plugin --- packages/slate-react/src/plugins/before.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/slate-react/src/plugins/before.js b/packages/slate-react/src/plugins/before.js index 7fd886a90..df2ba13b3 100644 --- a/packages/slate-react/src/plugins/before.js +++ b/packages/slate-react/src/plugins/before.js @@ -244,7 +244,7 @@ function BeforePlugin() { event.stopPropagation() event.preventDefault() - if (editor.props.readOnly) return + if (editor.props.readOnly) return true const { state } = change const { nativeEvent } = event @@ -328,7 +328,7 @@ function BeforePlugin() { */ function onKeyDown(event, data, change, editor) { - if (editor.props.readOnly) return + if (editor.props.readOnly) return true const { key } = event @@ -392,7 +392,7 @@ function BeforePlugin() { */ function onPaste(event, data, change, editor) { - if (editor.props.readOnly) return + if (editor.props.readOnly) return true event.preventDefault() const d = getEventTransfer(event) @@ -416,9 +416,9 @@ function BeforePlugin() { */ function onSelect(event, data, change, editor) { - if (isCopying) return - if (isComposing) return - if (editor.props.readOnly) return + if (isCopying) return true + if (isComposing) return true + if (editor.props.readOnly) return true const window = getWindow(event.target) const { state } = change @@ -433,7 +433,7 @@ function BeforePlugin() { // Otherwise, determine the Slate selection from the native one. else { let range = findRange(native, state) - if (!range) return + if (!range) return true const { anchorKey, anchorOffset, focusKey, focusOffset } = range const anchorText = document.getNode(anchorKey)