Collapsible gets stuck when content is empty or zero-height
See original GitHub issueDescribe the bug
This component depends on the onTransitionEnd
event being fired to update its internal state. However, if the content of the collapsible is empty, then no transition happens and thus onTransitionEnd
doesn’t fire, leaving the component stuck.
As a result, if you have a component with empty (or zero-height) content that’s open, and then close it, it will get stuck in the closed position.
To Reproduce
I made a repro by adapting the “example” code. I’m on Chrome 86.
git clone git@github.com:thomasjm/react-collapsible.git
cd react-collapsible
npm run example
# Click on the collapsible once and it will go from open -> closed
# Click on it a second time and it won't re-open
Expected behavior Collapsible should open and close when clicked, even if the content is empty.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
⭐️ What's new? · Help Center
One with a list of components that the current component contains. If either list is empty, the panel will remain hidden. Additionally, when...
Read more >389321 - Caret invisible or at wrong place with empty ...
Part 2: Fix a caret which doesn't get erased completely. 13 years ago ... First of all, I don't know why the empty...
Read more >CodeMirror: Release History
Fix issue that in some circumstances caused content to be clipped off at the bottom after a resize. markdown mode: Improve handling of...
Read more >Version History | Nova
Fixed. The cursor insertion point should no longer be obscured by the code structure headers in some circumstances; Fixed an issue where closing...
Read more >PHP 5 ChangeLog
Fixed bug #70852 (Segfault getting NULL offset of an ArrayObject). ... Fixed bug #69402 (Reading empty SSL stream hangs until timeout).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thomasjm I got this when using
yarn link
too, however, it did not appear when installing the branch directly, e.gIt was into a fresh next.js app and worked fine, it might be something to do with the way types are referenced when using
link
so I’m going to leave it for now.I’m not at my pc at the moment but should be able to release a patch version later on today.
Thanks @karltaylor!