ValentinH / react-easy-sort

A React component to sort items in lists or grids
https://ValentinH.github.io/react-easy-sort
MIT License
160 stars 25 forks source link

Get frozen in the beggining of dragging #36

Closed maliyshock closed 1 year ago

maliyshock commented 1 year ago

Describe the bug Screencast https://monosnap.com/file/MDzhQb8rqjstWKtfvK4RAUoAcgH3CR

To Reproduce 1) Go here https://codesandbox.io/s/magical-bardeen-x7sx6y?file=/src/App.js

2) Take first image and drag it down by holding button down (i use macbook with a trackpad by the way)

Expected behavior The same as on demo here https://codesandbox.io/s/react-easy-sort-images-demo-forked-tdsgnz?file=/src/App.tsx:157-169

Current behavior It got frozen until you release your click button. It stay sticky to your cursor even you are not holding clicking down the mouse button

I do not know exactly why it is happening, it looks like the mouseMove event listener stopping to work. But I could not catch what actually blocks it. I think it might be related to 17.0.2 version of react, but i am not sure.

No errors or warning messages though.

maliyshock commented 1 year ago

If you add draggable={false} to the image it solves the issue. I do not know how and why... but if it is that important i assume it should be mentioned in the documentation

ValentinH commented 1 year ago

Indeed, images should use drraggable=false. This is done in the demos but you are right, we should add it to the docs. Probably, in this section, even though it's not CSS : Screenshot_2023-08-01-20-16-20-04_320a9a695de7cdce83ed5281148d6f19.jpg

would you like to submit a PR?

maliyshock commented 1 year ago

I used code from examples from the demo, the whole thing, and there were no such attributes. So I guess they might exist not everywhere. Thank you for the update!