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

Scrollbar is displayed in error if element has a border #296

Open
philipstratford opened this issue Jan 12, 2018 · 0 comments
Open

Scrollbar is displayed in error if element has a border #296

philipstratford opened this issue Jan 12, 2018 · 0 comments

Comments

@philipstratford
Copy link

philipstratford commented Jan 12, 2018

Firstly I'd like to say that I think this plugin is excellent and, of the many plugins out there designed for this purpose, this is the one I've found the nicest to work with.

If I apply slimScroll to an element with a max-height property set and the contents of that element is smaller in height than the max-height value of its parent, the slimScroll scrollbar is not displayed. Once the contents' height exceeds the parent's max-height value, the scrollbar is displayed. This is exactly as expected.

However, if the parent element has a border - for example border: 1px solid black - the scrollbar is always displayed, even if the contents of the element are not taller than the parent's max-height value and a scrollbar is not required.

I've created a fiddle to demonstrate the problem here. Note that the div has an unnecessary scrollbar at all times, but that if you remove the border property from its style the scrollbar disappears and functions as normal (i.e. if you had more <li> elements the scrollbar will be displayed as expected.

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

No branches or pull requests

1 participant