SimpleBar container width collapsed when used in absolutely positioned container
See original GitHub issueDescribe the bug
SimpleBar container width is collapsing when used in floating (position: absolute
) container.
To Reproduce
Use SimpleBar component within floating div
Expected behavior
Please correct me if I’m wrong, but from my understanding it should behave same as regular div
with native overflow: hidden scroll
property (adjust width to width of child elements, based on hardcoded css value or based on content).
Reproducible example
https://stackblitz.com/edit/react-ts-stdesm
Please check 2 boxes, red
box is using native scroll, pink
box is using SimpleBar component.
Your environment
Software | Version(s) |
---|---|
SimpleBar | 5.1.0 |
Browser | Chrome 79.0.3945.79 |
npm/Yarn | |
Operating System | Linux |
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Position absolute box causes container to collapse
If the parent container that holds the absolute elements doesn't have an explicit height or width, it will collapse.
Read more >scrollbar - CSS-Tricks
::-webkit-scrollbar-thumb addresses the draggable scrolling element that resizes depending on the size of the scrollable element; ::-webkit- ...
Read more >Untitled
climateAtlasTooltip{padding:16px!important}.shadowed{-webkit-box-shadow:2px 4px ... video{position:absolute;top:0;left:0;width:100%;height:100%}.tag-list ...
Read more >Help - iTOL
Collapsed clades; Colored ranges display options; Dataset visibility and order in the legend box. Note that the zoom level and the position of...
Read more >Untitled
... .img-circle { border-radius: 50%; } .sr-only { position: absolute; width: 1px; ... background-clip: padding-box; } .obsolete .simplebar-track:hover ...
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 Free
Top 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
Fixed in latest version.
@Grsmto Is there any solution to this issue?