You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an item of overly-wide content with overflow: auto or overflow: scroll is a descendant — but not a direct child — of a grid container, and the relevant column is defined solely in terms of the fr unit, the item will fail to conform to its parent's width.
Workarounds include:
Add a non-fr unit (even if uselessly small) as part of the template-column-width declaration. For example, change grid-template-columns: 1fr to grid-template-columns: minmax(1px 1fr).
Put display: grid on the immediate parent of the item. (Not appropriate for every circumstance.)
Here's a demo / reduced test case. First the HTML:
<!-- The divs below are identical except for class and h2: --><divclass=foo><article><h2>This article's parent div has '1fr' column</h2><p>Right end of <pre> should not be visible before side-scrolling:</p><pre><spanclass=good>Start</span> . . . . . . . . . . . . . <spanclass=bad>End</span></pre></article></div><divclass=bar><article><h2>This article's parent div has 'minmax(1px, 1fr)' column</h2><p>Right end of <pre> should not be visible before side-scrolling:</p><pre><spanclass=good>Start</span> . . . . . . . . . . . . . <spanclass=bad>End</span></pre></article></div>
(If you omit the pretty stuff, you might need to narrow the body even more to cause overflow on the <pre> element and thus observe the bug in action.)
The text was updated successfully, but these errors were encountered:
tomhumiston
changed the title
In columns sized only with fr unit, overflow: auto (or scroll) is ignored in grandchild elements
In columns sized only with 'fr' unit, overflow: auto (or scroll) is ignored in grandchild elements
Aug 26, 2019
When an item of overly-wide content with
overflow: auto
oroverflow: scroll
is a descendant — but not a direct child — of a grid container, and the relevant column is defined solely in terms of thefr
unit, the item will fail to conform to its parent's width.Workarounds include:
fr
unit (even if uselessly small) as part of the template-column-width declaration. For example, changegrid-template-columns: 1fr
togrid-template-columns: minmax(1px 1fr)
.display: grid
on the immediate parent of the item. (Not appropriate for every circumstance.)Here's a demo / reduced test case. First the HTML:
Now the CSS:
(If you omit the pretty stuff, you might need to narrow the body even more to cause overflow on the
<pre>
element and thus observe the bug in action.)The text was updated successfully, but these errors were encountered: