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

[accordion][collapsible] With CSS transitions the panel does not resize when content size changes #1458

Open
M1dnight-ofcl opened this issue Feb 17, 2025 · 1 comment
Labels
bug 🐛 Something doesn't work component: accordion This is the name of the generic UI component, not the React module! component: collapsible This is the name of the generic UI component, not the React module!

Comments

@M1dnight-ofcl
Copy link

Bug report

Current behavior

I have a resizable sidebar and a group of collapsible. The problem is, that whenever I resize the collapsible or delete an element from the collapsible, it doesn't resize, and it leads to annoying bugs
Idle:
Image
Deleted Element:
Image
Fully Expanded Sidebar:
Image

Now when I close the collapsible and reopen it, it does account for the new size, but I wish that it would observe the size change (maybe using ResizeObserver) and account for it

Expected behavior

I wanted the collapsible to resize according to the new change

Reproducible example

Just create a collapsible, and try using states to remove one of the elements (like using a map) or shrink it

Base UI version

v1.0.0-alpha.6

Which browser are you using?

Microsoft Webview2 (on wails)

Which OS are you using?

Windows 11

Which assistive tech are you using (if applicable)?

Voiceover/JAWS etc.

Additional context

Provide any additional context that might help us identify the problem and find a solution.

@M1dnight-ofcl M1dnight-ofcl added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 17, 2025
@mj12albert mj12albert added component: collapsible This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 18, 2025
@mj12albert mj12albert self-assigned this Feb 18, 2025
@mj12albert mj12albert changed the title Collapsible does not dynamically resize on size change [Collapsible] Does not dynamically resize when content size changes Feb 18, 2025
@oliviertassinari oliviertassinari changed the title [Collapsible] Does not dynamically resize when content size changes [collapsible] Does not dynamically resize when content size changes Mar 1, 2025
@mj12albert
Copy link
Member

@M1dnight-ofcl Seems to be an issue with using CSS transitions since it requires explicitly setting height in CSS, that's what you're using right?

Using CSS keyframe animations avoids this: https://codesandbox.io/p/sandbox/bold-sun-7h6xm6?file=%2Fsrc%2Findex.module.css%3A20%2C1

@mj12albert mj12albert changed the title [collapsible] Does not dynamically resize when content size changes [accordion][collapsible] Does not dynamically resize when content size changes Mar 6, 2025
@mj12albert mj12albert added the component: accordion This is the name of the generic UI component, not the React module! label Mar 6, 2025
@mj12albert mj12albert changed the title [accordion][collapsible] Does not dynamically resize when content size changes [accordion][collapsible] When using CSS transitions the panel does not resize Mar 6, 2025
@mj12albert mj12albert changed the title [accordion][collapsible] When using CSS transitions the panel does not resize [accordion][collapsible] With CSS transitions the panel does not resize when content size changes Mar 6, 2025
@mj12albert mj12albert added the bug 🐛 Something doesn't work label Mar 6, 2025
@mj12albert mj12albert removed their assignment Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: accordion This is the name of the generic UI component, not the React module! component: collapsible This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

2 participants