Skip to content

Commit 1b9d66e

Browse files
author
Ralph Huwiler
committed
check if dragLayer has been rendered
1 parent 59ce5ec commit 1b9d66e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/VueNestable.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ export default {
306306
// In some cases the drag-layer might not be at the top left of the window,
307307
// we need to find, where it acually is, and incorperate the position into the calculation.
308308
const elDragLayer = document.querySelector('.nestable-' + this.group + ' .nestable-drag-layer')
309+
if (!elDragLayer) return
309310
const { top: dragLayerTop, left: dragLayerLeft } = elDragLayer.getBoundingClientRect()
310311
311312
const elCopy = document.querySelector('.nestable-' + this.group + ' .nestable-drag-layer > .nestable-list')

0 commit comments

Comments
 (0)