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] Drag ends when mouse leaves the BrushHandle #1109

Closed
Atralbus opened this issue Mar 15, 2021 · 1 comment
Closed

[brush] Drag ends when mouse leaves the BrushHandle #1109

Atralbus opened this issue Mar 15, 2021 · 1 comment

Comments

@Atralbus
Copy link

Atralbus commented Mar 15, 2021

When we create a new brush rect, we can move the mouse outside the brush area while dragging. If we don't trigger mouseup we can move the mouse back in to the brush area to continue dragging. But when we trigger a drag from BrushHandle and move mouse outside the brush area it immediately triggers dragEnd which prevents us to continue brushing by moving mouse inside the brush area.

Steps to reproduce the behavior:

  1. Go to https://airbnb.io/visx/brush.
  2. Drag the brush from left or right handle and move mouse outside the brush area.
  3. Move back mouse inside the brush area while holding left mouse button.
  4. See that brush no longer moves.

I think we should be able to move brush even if the mouse leaves the brush area or handle.

Correct behavior in BaseBrush
Screen Recording 2021-03-15 at 15 40 35

The problem with BrushHandle
Screen Recording 2021-03-15 at 15 40 20

This is a minor issue with the user experience of Brush component. But there seems to be a bigger problem. Currently, the component cannot catch up with fast mouse move events, if you move mouse outside the brush area too fast, it will leave the brush a bit far from the edge of the brush area. If you check this d3 demo you can see that no matter how fast you move mouse outside, it stops on the edge of the brush area. This greatly improves the user experience with the component. Here's the fast drag issue;

Screen Recording 2021-03-15 at 16 06 43

Thank you for this great library. It makes it a lot easier to create complex charts in React. Hoping to see more.

@williaster
Copy link
Collaborator

closed by #1164

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