1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 09:59:48 +02:00

fix error when dragging void nodes without selection, closes #757

This commit is contained in:
Ian Storm Taylor
2017-04-28 13:17:00 -07:00
parent 17ea3ed349
commit 26777b43a5

View File

@@ -9,6 +9,8 @@ import isBackward from 'selection-is-backward'
*/ */
function scrollToSelection(selection) { function scrollToSelection(selection) {
if (!selection.anchorNode) return
const window = getWindow(selection.anchorNode) const window = getWindow(selection.anchorNode)
const backward = isBackward(selection) const backward = isBackward(selection)
const range = selection.getRangeAt(0) const range = selection.getRangeAt(0)