Comments (5)
As a workaround, for both browsers, try setting the .sidebar
class to grid-template-rows: 20px 170px;
The 170px accounts for the original fixed height of 200px minus the header and border.
from gridbugs.
@jwdunn1 Thanks for that suggestion, that does seem to work for the example. Unfortunately the real-world situation this was inspired by is a bit more dynamic and the height of the main .container, and therefore also the .sidebar is dynamic so I can't hard-code the height in the css is this way.
I tried using calc but that doesn't make a difference to the rendering i.e.
grid-template-rows: 20px calc(100% - 20px);
from gridbugs.
Perhaps an alternative workaround: remove the nested grid.
From the .sidebar
remove:
display: grid; grid-template-rows: 20px auto; height: 100%; max-height: 100%
And add: overflow: auto;
Then add position: sticky;
and top: 0;
to the .sidebar-header;
See forked example: https://codepen.io/anon/pen/vrXYQq
from gridbugs.
@jwdunn1 Thanks again. That definitely works, just a shame we have to live with the scrollbar in the sidebar header but close enough I think
Interestingly, I tried to workaround the issue with flexbox: https://codepen.io/anon/pen/eKdzzv but it has the exact same issue (i.e. works in Firefox but overflows in Chrome/Edge).
from gridbugs.
@martyns To remove the scrollbar in the sidebar header, I made a few more adjustments (works in Chrome and Firefox): https://codepen.io/anon/pen/dKpXKw (Basically, removing the .sidebar
division and reassigning the sidebar header and content into their own cells of the original grid.)
from gridbugs.
Related Issues (20)
- Has this fit-content / max-content bug been added yet?
- Chrome: justify/align-content do not work with flexbox HOT 1
- Webkit: Vertical writing-mode with margin on auto width column renders too large
- [Safari] When height is not specified for the parent element, the height of the child is 0 HOT 2
- height: 100% changes a calculation based on sibling's intrinsic vs. explicit height
- CSS grid doesn't support word-wrap, overflow-wrap and hyphens properties HOT 1
- height: 100% on an image inside a grid, resize the image to height 0 HOT 1
- Nested grids with sticky positioning problem in Edge HOT 1
- Grid Height Chrome
- Specifying grid-template-columns using only percentages overrides box sizing HOT 3
- Grid overflow doesn't fit HOT 1
- Extra overflow-x on mobile devices
- safari: changing grid-item position to fixed on browser resize not supported HOT 1
- `repeat` with `auto-fill`, `minmax` and max-value being a `percentage` overflows instead of wrapping
- In columns sized only with 'fr' unit, overflow: auto (or scroll) is ignored in grandchild elements
- dark-themed browser issues HOT 1
- Safari Gives unexpected results with (I think) use of repeat auto HOT 4
- Safari align-content: center bug with nested grid container HOT 1
- Nested grid performance in Safari
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridbugs.