johman10 / flood-for-transmission

A Flood (https://github.com/Flood-UI/flood) clone for Transmission
GNU General Public License v3.0
339 stars 33 forks source link

Fix column reordering in Safari and Firefox #511

Closed kapoko closed 1 year ago

kapoko commented 1 year ago

Fixes #427

Noticed this problem in Firefox as well. I think this pull request addresses 2 little problems:

  1. The dragover event gets fired continuously during dragging. On the callback the DOM is manipulated to update the list. Somehow Chrome handles this pretty well but on Firefox it just flooded the event queue I guess and the drop event was not fired most of the time. I added a simple check below to see if we should update the DOM or not.
if (draggingElement.id === item.id) return;
  1. Now Firefox was working, but Safari was still giving problems. Setting the drag image to an empty div doesn't work in Safari apparently. I replaced it with an inline GIF, a 1x1 transparent pixel, the smallest I could find.

Tested on Firefox, Safari and Chrome. Thanks for your work!

johman10 commented 1 year ago

Thank you so much for you contribution @kapoko! This was super helpful as I wasn't able to find a good way to debug the issues in Safari.

I trust that this works, but if you discover any further issues, please open a new PR.