dragend, dragenter, and dragleave firing off immediately when I drag

后端 未结 6 912
梦谈多话
梦谈多话 2020-12-29 05:02

I\'m trying to make a list of elements which can be repositioned by dragging and dropping. The first element, Box 1, works just fine 100% of the time. Sometimes the second b

6条回答
  •  旧时难觅i
    2020-12-29 05:23

    Had this problem just now - it is a Chrome bug, you must not manipulate the DOM in dragStart event, or else dragEnd fires immediately. The solution for me turned out to be - use setTimeout() and manipulate the DOM inside the function you timeout.

提交回复
热议问题