question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Collapsible gets stuck when content is empty or zero-height

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
karltaylorcommented, Jan 29, 2021

@thomasjm I got this when using yarn link too, however, it did not appear when installing the branch directly, e.g

yarn add https://github.com/glennflanagan/react-collapsible.git\#fix/177-open-close-with-zero-height

It 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.

0reactions
thomasjmcommented, Jan 29, 2021

Thanks @karltaylor!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found