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.

Parent element padding not included

See original GitHub issue

When the target element ([data-simplebar="init"]) has right padding (6px in this case), the .simplebar-scroll-content should also have the same padding added to the “scrollbar width” padding. Otherwise the native scrollbar becomes visible.

[data-simplebar=“init”] (6px right-padding) image

.simplebar-scroll-content (20px right-padding and 26px right-padding) image image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelkolbercommented, Jul 22, 2018

Can this perhaps be added to the Caveats section in the README? I had to search to find this, and while the solution was as easy as adding a container, having it on the repo’s homepage would have been helpful.

0reactions
Grsmtocommented, Nov 1, 2017

Hi guys,

I’m not 100% sure that’s the problem you encountered but the solution for this can be seen on this jsfiddle, you can see I applied a padding-right: 60px on the container: https://jsfiddle.net/Grsmto/y6fj691y/7/

The div on which you apply SimpleBar should be empty of any “layout” css property, otherwise it can break SimpleBar calculations. So if you want to add like, a padding, you’ll have to add an extra container div where you apply your padding.

I don’t want to start trying to “read” the css of the user and try to patch SimpleBar based on that cause it seems like a slippery slope to me (too many scenarios to handle) so I prefer to let that to the user!

Hope this help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ignore parent padding - Stack Overflow
I'm trying to get it to ignore the padding that everything else in the parent div needs.
Read more >
CSS to ignore parent padding in 4 lines - Milind Soorya
Solution. Give this below piece of CSS to the element you wish to break out(pun Intended). The max-width is required because otherwise, you...
Read more >
How do you ignore a parent padding in CSS? - Quora
Just using a simple CSS id declaration allows you to separate specific parent elements that the “no padding” rule would apply to.
Read more >
Oh Hey, Padding Percentage is Based on the Parent ...
I always thought that percentage padding was based on the element itself. So if an element is 1,000 pixels wide with padding-top: 50%...
Read more >
box-sizing - CSS: Cascading Style Sheets - MDN Web Docs
If you set an element's width to 100 pixels, that 100 pixels will include any border or padding you added, and the content...
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