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

Is onBrushEnd broken for the Brush component? #1283

Closed
JoeVanGundy opened this issue Jul 20, 2021 · 3 comments
Closed

Is onBrushEnd broken for the Brush component? #1283

JoeVanGundy opened this issue Jul 20, 2021 · 3 comments

Comments

@JoeVanGundy
Copy link

JoeVanGundy commented Jul 20, 2021

Is onBrushEnd broken for the Brush component?

The docs say: Callback invoked on mouse up when a Brush size is being updated.

Not sure if I’m misunderstanding what this is suppose to do, but I would expect this callback to only fire when the user lets go of a mouse drag. Instead, I’m seeing it fire every time the value of the brush changes.

I'm keeping track of the current start and end dates using useState.
Since onBrushEnd is being calling so many times, I'm setting the state like 50 times during one short drag and performance is tanking hard.

Thanks!

@williaster
Copy link
Collaborator

Yep this is definitely broken. This may have been introduced in a recent update here and is specific to when useWindowMoveEvents={true}.

Shouldn't be too hard to fix, I'll try to get something out today.

@williaster
Copy link
Collaborator

closed by #1286

@JoeVanGundy
Copy link
Author

JoeVanGundy commented Aug 9, 2021

closed by #1286

@williaster Forgot to say thanks for fixing this so fast!!
Thanks!!

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

No branches or pull requests

2 participants