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

Still resizes after releasing mouse outside window #340

Closed
Fabioni opened this issue Apr 18, 2024 · 4 comments · Fixed by #374
Closed

Still resizes after releasing mouse outside window #340

Fabioni opened this issue Apr 18, 2024 · 4 comments · Fixed by #374
Assignees
Labels
help wanted Extra attention is needed

Comments

@Fabioni
Copy link

Fabioni commented Apr 18, 2024

Check out the sandbox: https://codesandbox.io/p/sandbox/react-resizable-panels-forked-r6zcm6

If you drag the resizer up until the first panel gets collapsed, and you release the mouse outside the iframe of codesandbox (or just outside your browser window) your code does not recognize the mouse release and still changes the panel size after the mouse hovers back over the iframe.

@Fabioni Fabioni changed the title Resizes after mouse releasing mouse Resizes after releasing mouse Apr 18, 2024
@Fabioni Fabioni changed the title Resizes after releasing mouse Still resizes after releasing mouse outside window Apr 18, 2024
@bvaughn
Copy link
Owner

bvaughn commented Apr 18, 2024

If you'd like to post a PR for this, I'll try to make the time to review it. Else I probably won't have the time to pick it up.

@afshawnlotfi
Copy link

afshawnlotfi commented Jun 20, 2024

Having the same issue

Edit: Fixed by updating package to the latest

@bvaughn bvaughn added the help wanted Extra attention is needed label Jul 2, 2024
in-ch pushed a commit to in-ch/react-resizable-panels that referenced this issue Jul 17, 2024
in-ch added a commit to in-ch/react-resizable-panels that referenced this issue Jul 17, 2024
@bvaughn bvaughn self-assigned this Jul 17, 2024
@bvaughn
Copy link
Owner

bvaughn commented Jul 17, 2024

I think the iframe in Code Sandbox is causing this behavior. Seems like the "pointerup" event isn't being registered if it's fired outside of the iframe. Maybe something is intercepting and canceling the event? Not sure.

Edit I think this is a cross-domain/origin issue. I think I can repro this behavior if I use an iframe that loads content from a different domain/host, but not if it's the same host.

@bvaughn
Copy link
Owner

bvaughn commented Jul 18, 2024

Fixed in #374 and released in 2.0.21

You can see the fix here in this updated Sandbox: https://codesandbox.io/p/sandbox/react-resizable-panels-forked-3h4km6


❤️ → ☕ givebrian.coffee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
3 participants