phphe / vue-draggable-nested-tree

Vue2 draggable tree component

Home Page:https://hetree.phphe.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Uncaught TypeError: Cannot read property 'classList' of null" when dragging branch

rabbitfufu opened this issue · comments

Hello! Firstly, thank-you for taking the time to develop this component, it is much needed by the community.

I have noticed that the following error appears intermittently in Chrome Dev Tools while dragging a branch of the tree:

helper-js.es.js?3962:1237 Uncaught TypeError: Cannot read property 'classList' of null
at hasClass (helper-js.es.js?3962:1237)
at Object.targetPrevEl (vue-draggable-nested-tree.es.js?b1f6:1043)
at eval (vue-draggable-nested-tree.es.js?b1f6:488)
at Cache.remember (vue-draggable-nested-tree.es.js?b1f6:460)
at Object.get (vue-draggable-nested-tree.es.js?b1f6:487)
at Object.targetPrev (vue-draggable-nested-tree.es.js?b1f6:1050)
at eval (vue-draggable-nested-tree.es.js?b1f6:488)
at Cache.remember (vue-draggable-nested-tree.es.js?b1f6:460)
at Object.get (vue-draggable-nested-tree.es.js?b1f6:487)
at Object.appendPrev [as append prev] (vue-draggable-nested-tree.es.js?b1f6:641)

At first I thought it must be my own code. However I am actually able to reproduce this same error on the vue-draggable-nested-tree demo site.

It's difficult to describe exactly how to reproduce this. It seems to happen when dragging a node in a circular motion repeatedly overtop of other nodes, forcing the tree to reflow. The error happens fairly consistently when I do this.

Thanks (in advance) for your help!

I also got it. But it does not affect normal use.

One thing I have found that it does break is hot-reloading during development. After a bunch of those errors occur, changes to the code are no longer hot-reloaded, and instead require a refresh.

It would be best if the script does not spill out errors during normal use.