Skip to content

Commit

Permalink
fixed ianstormtaylor#1237 which calls Selection.getRangeAt(0) when Se…
Browse files Browse the repository at this point in the history
…lection.type = 'None' (ianstormtaylor#2920)

it should check the latest rangeCount, not the previous memorized one
  • Loading branch information
ruanyl authored and ianstormtaylor committed Aug 19, 2019
1 parent 65796c8 commit 8ab49c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/slate-react/src/components/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8ab49c0

Please sign in to comment.