1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-16 04:04:06 +02:00

fixed #1237 which calls Selection.getRangeAt(0) when Selection.type = 'None' (#2920)

it should check the latest rangeCount, not the previous memorized one
This commit is contained in:
Yulong Ruan
2019-08-20 00:24:49 +08:00
committed by Ian Storm Taylor
parent 65796c8ba0
commit 8ab49c04c4

View File

@@ -251,7 +251,7 @@ class Content extends React.Component {
// Otherwise, figure out which DOM nodes should be selected...
if (selection.isFocused && selection.isSet) {
const current = !!rangeCount && native.getRangeAt(0)
const current = !!native.rangeCount && native.getRangeAt(0)
const range = editor.findDOMRange(selection)
if (!range) {