Solution 1 :

If you remove this row it will work (line 182):


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);

Problem :

I have a problem with a href="... it doesn’t work. When i right click on it i can open it in new tab easily but when i left click it doesn’t work at all, i think is because of JS script but i have no idea how to change it. It might but that <div id="planes"> getting class="dragged"

Link to: CodePen

And thanks to Jeff Mignone for this script


Comment posted by

@OrBen-Yossef the HTML is forgiving and it is ignored.