GithubHelp home page GithubHelp logo

Comments (5)

jwdunn1 avatar jwdunn1 commented on May 18, 2024

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.

martyns avatar martyns commented on May 18, 2024

@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.

jwdunn1 avatar jwdunn1 commented on May 18, 2024

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.

martyns avatar martyns commented on May 18, 2024

@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.

jwdunn1 avatar jwdunn1 commented on May 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.