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

Ability to keep dragging with mouse outside the window #42

Closed
NMinhNguyen opened this issue Dec 29, 2022 · 3 comments · Fixed by #44
Closed

Ability to keep dragging with mouse outside the window #42

NMinhNguyen opened this issue Dec 29, 2022 · 3 comments · Fixed by #44

Comments

@NMinhNguyen
Copy link

NMinhNguyen commented Dec 29, 2022

If you compare https://codesandbox.io/s/react-resizable-panels-zf7hwd and https://react-grid-layout.github.io/react-grid-layout/ you'll notice that react-grid-layout lets you keep dragging even if your mouse leaves the window, but with react-resizable-panels the drag event seems to stop as soon as the mouse leaves the window.

This is probably not a dealbreaker, but it would arguably be nicer UX if the drag event didn't just stop if you accidentally dragged too much.

Sorry, I'm currently on my phone so I can't record a video to make it crystal clear what I'm talking about but I hope the description suffices!

@bvaughn
Copy link
Owner

bvaughn commented Dec 29, 2022

The behavior of react-resizable-panels was intentional. I wanted to avoid the case of being stuck in a resize when you mouse up while outside of the window. I'm not sure if "mouseup" is guaranteed to always fire if the mouse has moved to another window.

Based on some quick testing though, it looks like Chrome, Firefox, and Safari all do a good job of handling this case (dispatching "mouseup" on the window) so maybe I can change this.

@bvaughn
Copy link
Owner

bvaughn commented Dec 29, 2022

Resolved in #44

@bvaughn bvaughn closed this as completed Dec 29, 2022
@bvaughn
Copy link
Owner

bvaughn commented Dec 29, 2022

Released in v0.0.23

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

Successfully merging a pull request may close this issue.

2 participants