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.

Collapse animation hides overflow

See original GitHub issue

🐛 Bug report

Elements wrapped in Collapse animation can’t overflow it. It causes problems for dropdowns.

💥 Steps to reproduce

  1. Go to https://codesandbox.io/s/eager-tereshkova-fr0mr
  2. Click on ‘Click Me’
  3. Open Dropdown
  4. Options should be clipped
  5. Click on ‘Toggle Theme’
  6. Options should not be clipped

💻 Link to reproduction

https://codesandbox.io/s/eager-tereshkova-fr0mr

🧐 Expected behavior

Collapse should allow overflow.

🧭 Possible Solution

Workaround is provided in Codesandbox. For a actual solution, I think that removing overflow: hidden from here would do. I can provide PR if that’s okay.

🌍 System information

Software Version(s)
Chakra UI 1.0.0
Browser Chrome 87
Operating System Win 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
frysztakcommented, Apr 20, 2021

@dusty best I came up with is this hack:

// theme.ts
const styles = {
  global: {
    ':not(.chakra-dont-set-collapse) > .chakra-collapse': {
      overflow: 'initial !important',
    },
  },
};

export const theme = extendTheme({
  styles,
  ...
});

by default, it sets overflow: initial !important so that overflow is visible. sometimes that’s not what you want. you can then set className="chakra-dont-set-collapse"

1reaction
Invizcommented, Dec 13, 2022
.chakra-collapse[style*="height: auto"] { overflow: initial !important }
Read more comments on GitHub >

github_iconTop Results From Across the Web

In UICollectionView, collapse animation is imperfect, with no ...
One from the bottom of the "show/hide" elements (their container view). Set the .priority of the second constraint to 750 ( .defaultHigh )....
Read more >
Collapse - Bootstrap
The collapse JavaScript plugin is used to show and hide content. Buttons or anchors are used as triggers that are mapped to specific...
Read more >
Hide Scrollbars During an Animation - CSS-Tricks
Another problem is scrollbars. When we set max-height: 0; , we also need overflow: hidden; to make sure the dropdown is actually hidden...
Read more >
overflow-x - CSS: Cascading Style Sheets - MDN Web Docs
The overflow-x CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, ...
Read more >
react-smooth-collapse-with-overflow - npm
React component for animating showing or hiding an element.. Latest version: 1.3.3, last published: 5 years ago.
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