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.

Modal with a single child has padding that causes scrolling issue

See original GitHub issue

Sandbox here: https://codesandbox.io/s/webpack-starter-c9g77

I have a modal with a single span element inside. For some reason, I’m able to scroll down to the point where the element disappears if there is only one line of text.

Start: Screen Shot 2020-02-03 at 4 41 17 PM

After scrolling: Screen Shot 2020-02-03 at 4 41 21 PM

I believe it’s because of this styling:

.bx--modal-content>*:last-child {
    padding-bottom: 2rem;
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
abbeyhrtcommented, Feb 4, 2020

The padding-bottom from the last-of-child is separate from what’s keeping the content far enough from the buttons. I added the padding to the last child so that the overflow-indicator doesn’t overlap the text at the end of the scrolling content when hasScrollingContent is set to true. Since it’s causing problems when the overflow indicator isn’t there, I believe I can just change it to not show up if hasScrollingContent is false.

0reactions
abvtecommented, Feb 4, 2020

The padding-bottom is causing the text to overflow, then causing the scrollbar to appear.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap Modal Issue - Scrolling Gets Disabled - Stack Overflow
One way to make it work, is to use the hidden.bs.modal event triggered by BS when closing a modal, then check if there...
Read more >
[Modal] Scrollbar and padding issue #10000 - mui/material-ui
The downside is that when the scrollbar is present, centered children are now 10 pixels to the right of center, and I have...
Read more >
overscroll-behavior - CSS: Cascading Style Sheets | MDN
The overscroll-behavior CSS property sets what a browser does when reaching the boundary of a scrolling area.
Read more >
Modal - Bootstrap
Modals are built with HTML, CSS, and JavaScript. They're positioned over everything else in the document and remove scroll from the <body> so...
Read more >
Prototype scrolling with overflow behavior - Figma Help Center
To apply overflow behavior, the frame must have content that extends beyond its bounds. If you change the bounds of the frame so...
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