glennflanagan / react-collapsible

React component to wrap content in Collapsible element with trigger to open and close.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting the contentHiddenWhenClosed attribute to true prevents the collapsible from opening at all.

bl-nero opened this issue · comments

Describe the bug
Looks like setting this attribute has a side effect of keeping the height attribute of the content element permanently at 0.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/happy-jones-v3zks
  2. Click on "Expand me".
  3. See that the collapsible attempts to expand (it even performs an animation), but the content doesn't show up.

Expected behavior
The collapsible content should be visible.

Screenshots
Jun-04-2021 14-57-59

Note that this attribute works correctly in version 2.8.1, where it was introduced by @arye-dov-eidelman.

I started looking into it And confirmed that it broke in commit d4c8d7c as part of version 2.8.2.

Setting the element to hidden causes the elements scrollHeight attribute to go back to 0. I'm thinking maybe setting the css visibility: hidden would be a better way to do this without affecting the height of the element.

commented

I started looking into it And confirmed that it broke in commit d4c8d7c as part of version 2.8.2.

Hi d4c8d7c was a fix for #177.

Does PR #195 fix both scenarios?

commented

Closing due to inactivity