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:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user