-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brush sometimes jumps around after releasing drag #1736
Comments
I ran into a similar issue lately. I was updating positions (react hooks) of draggable components in an onDragEnd event, which should cause a re-rendering. However, I found that the dx and dy fed to useDrag function did not update until the positions changed. It means that dx & dy were only reset to 0 after a re-rendering took place. |
I haven't looked under the hood or anything... but this jumpy behavior goes away by adding a delay (with debounce) to the onChange function of the Brush component. This does come at the cost of not having a smooth re-render of the chart while you are moving the brush around:
|
I have added the debounce but facing an issue : on leaving the handle my min and max values are increased by certain amount |
Fixed in #1836. Released in |
At my work, I had to create a graph using the Brush component. I noticed that after moving the selection, it slides to a different place than it should. Most of the time it's not noticeable, but occasionally there's a noticeable jump.
I have successfully reproduced this bug in the demo of the brush, as can be seen in the video below:
2023-07-27.17-37-37.mp4
The text was updated successfully, but these errors were encountered: