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.

Nested grid layouts cause UI to overflow/break

See original GitHub issue

What MDC-Web Version are you using?

0.16.0

What browser(s) is this bug affecting?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Also affects Firefox: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:54.0) Gecko/20100101 Firefox/54.0

What OS are you using?

OSX 10.11.6, but tested it on a coworkers laptop running OS 10.12.5

What are the steps to reproduce the bug?

  1. Run the demo server (or view the demo site)
  2. Go to localhost:8080/layout-grid.html (or https://material-components-web.appspot.com/layout-grid.html)
  3. Ensure that the Desktop Margin and Desktop Gutter are set to the defaults of 24px
  4. Scroll to the Grid nested within parent cell example
  5. Resize the browser window to <939px width (may vary per screen)
  6. Notice that the gutter between the first and second elements begin to shrink and eventually overlap, before resizing to tablet <840px

I also have a template on CodePen which I made to test whether it had something to do with the amount of nested grids or the span size of the cells.

What is the expected behavior?

I would expect it to continue resizing down gracefully instead of breaking out of the grid/alignment.

What is the actual behavior?

mdc-layout-grid__cell are overflowing outside of their mdc-layout-grid__inner wrappers when the mdc-layout-grid__inner width is too small.

Here is a gif of the behaviour

Any other information you believe would be useful?

Here’s an additional example wireframe of the layout I’m trying to achieve

Notice how on resize the elements 3 and 4 overflow outside the grid

Hopefully this is enough info, let me know if I missed anything!

Loving the library btw 😃 Cheers!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:8
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
bonniezhoucommented, Jan 29, 2018

Yep it’s a bug, thanks for filing it! It’s put in the tracker.

0reactions
elyobocommented, Apr 1, 2021

I’m sorry, but I have no idea any more!

Read more comments on GitHub >

github_iconTop Results From Across the Web

overflow scroll breaks in nested grid
One element is a nested grid container. But that shouldn't matter. However, if you look at the bigger picture, neither scrollbar should work....
Read more >
overflow-wrap - CSS: Cascading Style Sheets - MDN Web Docs
The overflow-wrap CSS property applies to inline elements, setting whether the browser should insert line breaks within an otherwise ...
Read more >
Nested Grid - Grid by Example
A simple example of nesting one grid inside another. Any Grid Area can become a grid itself, by setting display:grid and then defining...
Read more >
CSS Subgrid - How to Build Complex Layouts in a Simple Way
Still, one particular issue remained - only direct children of a grid container will align with the grid. In case you need deeply...
Read more >
CSS Grid Level 2: Here Comes Subgrid - Smashing Magazine
When using CSS Grid Layout, you can already nest grids. In the example below, I have a parent grid with six column tracks...
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