clauderic / clauderic/react-sortable-hoc
Dispatch state before drag starts is taking effect only when the mouse is released.
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 959
- PR merge metrics
- No merged PRs in 30d
Description
There is a prop `updateBeforeSortStart` that's useful for run asynchronous code before dragging. I need to call a setState before the drag starts, which changes some things on the list.
**The issue:**
For some reason the set state dispatcher is being called and I can see the new state value correctly in the console but it doesn't take effect in the ui until the dragged row (mouse) is released, so all changes are reflected after dragging.
How can I prevent this? I really need to see this state changes reflected in the ui before dragging starts.
This state that I need to dispatch is in charge of collapse some parents (tree list) before drag.
Is this an issue? What can I do?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the behavior with `updateBeforeSortStart` and the tree-list state that collapses parents before dragging. Trace when the `setState` dispatch occurs relative to the drag lifecycle, then verify that the collapsed state is visible before the dragged row is released.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100