Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleBar container width collapsed when used in absolutely positioned container #430

Closed
resetko opened this issue Jan 2, 2020 · 8 comments
Labels

Comments

@resetko
Copy link

resetko commented Jan 2, 2020

Describe 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
@Grsmto Grsmto added the bug label Jan 7, 2020
@ErikParso
Copy link

I have a same problem, i want to use simplebar to scroll through options in my dialog

@vladkramar
Copy link

Same issue.

@ErikParso
Copy link

Any progress on this issue ?

@Techwolfy
Copy link

I ran into this issue when attempting to apply SimpleBar to a Bootstrap dropdown menu. I was able to work around it by manually calculating and setting the width on the containing element, but I'd strongly prefer a CSS-based solution within the library.

@Grsmto
Copy link
Owner

Grsmto commented May 12, 2020

Fixed in latest version.

@Grsmto Grsmto closed this as completed May 12, 2020
@jojkos
Copy link

jojkos commented May 25, 2020

I have changed the version of SimplerBar used in the example and i don't think that the behavior is now completely correct https://stackblitz.com/edit/react-ts-q9u8l4.

The container isn't completely collapsed as it was before, but the width doesn't stretch properly to fit whole content. Is there something i'm missing?

@danylo-holovenko
Copy link

@Grsmto Is there any solution to this issue?

@m3l1x
Copy link

m3l1x commented Jul 28, 2023

it seems like the flex environment is broken again since 6.0.0, if a container element has width: min-content, SimpleBar does not allow the container to shrink back once it has got bigger, due to the width that has been set on the simplebar-placeholder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants