Skip to content
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] onChange is executed after onBrushEnd #1885

Open
xavi-ortega opened this issue Nov 13, 2024 · 0 comments
Open

[Brush] onChange is executed after onBrushEnd #1885

xavi-ortega opened this issue Nov 13, 2024 · 0 comments

Comments

@xavi-ortega
Copy link

When dragging the brush, the onChange callback is triggered several times during the process, which is correct, but when stop dragging an additional onChange event is triggered right after onBrushEnd.

Is this expected? Is there a workaround I can use to know when drag is finished and not receiving any additional input after finishing?

My use case is updating the main app state during onChange, and when drag ends, I want to show a tooltip with the updated state. The issue is that while dragging (onChange) I have a state with a boolean to avoid showing the tooltip until it really ends, which is inconvenient because I set it to false when onBrushEnd is triggered, but it's back to true again when the last onChange runs.

Demo (fork of Brush doc): https://codesandbox.io/p/sandbox/youthful-browser-vq8x4p
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant