-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
fix: still resizes after releasing mouse outside window (#340) #373
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
}); | ||
verifyAttribute(leftElement, "data-resize-handle-state", "inactive"); | ||
verifyAttribute(rightElement, "data-resize-handle-state", "inactive"); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test seems to give a false positive. (I can remove the change you made entirely and it will still pass.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I also think this fix may make the most sense in the resize handle registry (where other Window event listeners are) but I haven't thought about it much. I'll give it a quick try this afternoon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason the test gives a false positive is that the handle is not down when the move event is fired.
That being said, since the test isn't simulating "mouseout" events– I don't think the approach would work anyway. This might be better structured as an e2e test.
I will take a pass at fixing the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the code review.
I will attempt to fix the test so that it works properly. Thank you. 😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot to leave an update. As I was looking at this the other day, I realize that I already had code in place to handle this (in the resize handler registry) and it mostly seems to work, but it doesn't work in the case of Code Sandbox (probably something specific to iframes seemingly not receiving "pointerleave" events). Might be worth focusing on that use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, having just added an iframe– this library seems to work fine. So I'm not sure what it is about Code Sandbox that's different. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I think I just realized what's going on by accidentally pushing a reference to localhost
in my commit. I think the issue is when the iframe is in a different domain than the parent frame. Lemme poke at that a bit more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm able to trigger a similar behavior by using sandbox="allow-scripts"
. I'll move forward from there and try to add a failing e2e test.
Edit 0586271
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out #374; I think I found a fix.
Thank you for the contribution. I ended up fixing this in #374 after looking into it. |
Fixed in #374 and released in 2.0.21 ❤️ → ☕ givebrian.coffee |
Thank you so much 😀 |
You are welcome! Thanks for the coffee! 😌 |
Resolves #340
Hello.
Added features to prevent the panel size from changing when the mouse cursor is out of the browser.