From 26777b43a5bdc2155ee35bc9957317abd59df952 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Fri, 28 Apr 2017 13:17:00 -0700 Subject: [PATCH] fix error when dragging void nodes without selection, closes #757 --- src/utils/scroll-to-selection.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/scroll-to-selection.js b/src/utils/scroll-to-selection.js index 62b0cab1e..618e4795c 100644 --- a/src/utils/scroll-to-selection.js +++ b/src/utils/scroll-to-selection.js @@ -9,6 +9,8 @@ import isBackward from 'selection-is-backward' */ function scrollToSelection(selection) { + if (!selection.anchorNode) return + const window = getWindow(selection.anchorNode) const backward = isBackward(selection) const range = selection.getRangeAt(0)