1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 22:02:05 +02:00

Remove warning in getFragmentAtRange for node (#652) (#657)

* remove warning in getFragmentAtRange for node (#652)

* fix typo
This commit is contained in:
Aliaksei Simanchyk 2017-03-19 02:02:12 +02:00 committed by Ian Storm Taylor
parent 0f59ef6447
commit 21c6762e15

View File

@ -524,7 +524,10 @@ const Node = {
? node.getFurthestAncestor(next.key)
: node.getFurthestAncestor(endKey)
nodes = node.getChildrenBetweenIncluding(startNode.key, endNode.key)
// Get children range of nodes from start to end nodes
const startIndex = node.nodes.indexOf(startNode)
const endIndex = node.nodes.indexOf(endNode)
nodes = node.nodes.slice(startIndex, endIndex + 1)
// Return a new document fragment.
return Document.create({ nodes })