smooth-dnd adds event listeners when the module is loaded. Functions like onMouseDown() can raise an exception if SmoothDnD() hasn't been called and you drag an element wrapped in <div class="smooth-dnd-draggable-wrapper"> because container will be undefined.
It might be better to only add the global event listeners the first time SmoothDnD() is called, or check container is set in onMouseDown()
smooth-dnd adds event listeners when the module is loaded. Functions like
onMouseDown()
can raise an exception ifSmoothDnD()
hasn't been called and you drag an element wrapped in<div class="smooth-dnd-draggable-wrapper">
becausecontainer
will be undefined.It might be better to only add the global event listeners the first time
SmoothDnD()
is called, or checkcontainer
is set inonMouseDown()
I have to wrap my dnd elements because they are created dynamically and smooth-dnd doesn't support this as per my issue https://github.com/kutlugsahin/smooth-dnd/issues/10