Why doesn't HTML5 drag and drop work in Firefox?

前端 未结 5 1242
感动是毒
感动是毒 2021-02-01 02:36

I have bound events to different elements, and when I drag them in all browsers, except Firefox, it works as expected. In firefox, however, it doesn\'t work at all. The only eve

5条回答
  •  遥遥无期
    2021-02-01 02:57

    FF has long standing issues with eating certain mouse events that originate from elements that have overflow set to auto or scroll.

    In my case, I had a well used library for drag and drop that worked perfectly in the samples and in my app on every browser but firefox. After digging through the tickets related to this, I found a solution that I fully credit to a contributor to this ticket https://bugzilla.mozilla.org/show_bug.cgi?id=339293

    which is to set -moz-user-select: none

    on the scrolled element being dragged from. It solved my particular problem.

提交回复
热议问题