3 ms·
As far as I've seen, that's really the only way. Maybe with a slight throttle for the onMouseMove handler if the performance isn't great. I wonder if a differe
by whichdan 5y ago
As far as I've seen, that's really the only way. Maybe with a slight throttle for the onMouseMove handler if the performance isn't great.
I wonder if a different UX would help? Like clicking on a card and clicking on the drop target instead of dragging it? It would be less tactile but also a lot nicer on a trackpad.
- wildrhythms 5y agoIn a previous project I needed to customize the look of the "drag ghost", so I set up a global state for <thing being dragged>, and used requestAnimationFrame to move the ghost around with the cursor. Drop-enabled elements would then listen for mouseup and check to see if something was being dragged. Lots of weird edge cases (what if the user moves the cursor off-screen?), so now I recommend using a library like React DnD or Dragula.