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

Don't cancel resize operations when exiting the window #44

Merged
merged 1 commit into from
Dec 29, 2022
Merged

Conversation

bvaughn
Copy link
Owner

@bvaughn bvaughn commented Dec 29, 2022

Only cancel when a "mouseup" (or "touchend") event is fired.

Resolves #42

@vercel
Copy link

vercel bot commented Dec 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-resizable-panels ✅ Ready (Inspect) Visit Preview Dec 29, 2022 at 8:16PM (UTC)

document.body.removeEventListener("mousemove", onMove);
document.body.removeEventListener("touchmove", onMove);
document.body.removeEventListener("mouseup", stopDraggingAndBlur);
window.removeEventListener("mouseup", stopDraggingAndBlur);
window.removeEventListener("touchend", stopDraggingAndBlur);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for right now, but I wonder if you'll need to eventually derive (or accept) the correct document and window to support rendering into iframes / child windows opened via window.open()

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe! I guess it depends on where this thing gets used. This works for now 😁

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 this pull request may close these issues.

Ability to keep dragging with mouse outside the window
2 participants