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)