-
-
Notifications
You must be signed in to change notification settings - Fork 109
[Collapsible][Accordion] Recalculate panel dimensions on layout resize #1704
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
Conversation
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
4098859
to
33f5610
Compare
} | ||
|
||
const win = ownerWindow(panel); | ||
win.addEventListener('resize', handleWindowResize); |
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.
Testing this a bit and it works well, just wondering is it not enough to only use ResizeObserver?
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.
In this case the ResizeObserver fires when transitioning the height, which is why I added if (panel.getAnimations().length > 0) {
to prevent its logic from running, but when resizing the window, I don't want any animations to occur so the resizing is 1:1 with layout.
For this purpose we can't reuse the ResizeObserver since we want regular transitions to work when opening/closing
Closes #1458