react-use-draggable-scroll icon indicating copy to clipboard operation
react-use-draggable-scroll copied to clipboard

grab and grabbing

Open VladimirHybriun opened this issue 2 years ago • 2 comments

Mouse cursor not switching between grab and grabbing

VladimirHybriun avatar Jun 25 '22 05:06 VladimirHybriun

Dear @VladimirHybriun,

Could you please provide more detail or, preferably, a Sandbox (or similar) setup to replicate the issue?

Thanks for reporting it!

rfmiotto avatar Jun 25 '22 13:06 rfmiotto

If you try to map an array state after set state in useEffect would cause this. But an array state map without set state would not cause this. (use default state value mapping) Test with React 18.2 and js version.

Also once mouse up, only container change cursor back to auto. All children stay in grabbing.

I think it's due to your layout effect not tracking the size change of children. If default state is a length of 5 array. I then later change to a length of 8 array. Once you grab exceed the length of 5, it cause grabbing cursor lock situation.

OkazakiNaoki avatar Oct 13 '23 02:10 OkazakiNaoki