If you remove this row it will work (line 182):
this.options.element.classList.add("dragged");
Its purpose, as seen at a glance, is to allow you to add a custom style when dragging.
The problem is that for to do so, it adds the class directly to the element that triggered the event. If this element is, for example, the tag ‘a’ you want, changing the element will interrupt the event handling and the click event will not handled as expected.
A possible solution is to add the class after some time (by using the setTimeout
function) or add the class to the parent of the element.
For example, replacing the above line with the following line will solve the problem as well (Don’t replace the 10 with 0, it will fail it):
setTimeout(() => this.options.element.classList.add("dragged"), 10);