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.

Left Navigation Sidebar Disappears When Returning to Big Viewport

See original GitHub issue

I checked that…

  • … the documentation does not mention anything about my problem
  • … the problem doesn’t occur with the default MkDocs template
  • … the problem is not in any of my customizations (CSS, JS, template)
  • … there are no open or closed issues that are related to my problem

Description

When tabs are enabled, ifyou are in any sub-page that belongs to a tab and you go from desktop layout to mobile, you use the side menu and navigate all the way back to the uppermost navigation level, and you go back to desktop layout, the left sidebar navigation disappears completely

Expected behavior

The left sidebar navigation should remain visible after switching back to desktop layout. For example in your documentation site for MkDocs Material Theme it should look like: image

Actual behavior

The left sidebar navigation disappears completely. As can be observed in the HTML inspector for Chrome, all elements nested inside

<div 
  class="md-sidebar md-sidebar--primary"
  data-md-component="navigation"...>
    ...
</div>

have a height of zero, which is why they aren’t visible as can be seen below: image

The previously mentioned containing div however still retains it’s height as can be seen below: image

Steps to reproduce the bug

I reproduced the bug using your documentation site and also using my own dummy site with no theme overriding or any other customizations. I will add images for both sites so you can see.

Preconditions

  • Tabs feature is enabled

Steps

  1. Go to Extensions page of Squidfunk’s MkDocs Material site Squidfunk’s image My site equivalent image

  2. Shrink window to trigger mobile layout

  3. Click on side menu button to make side menu appear Squidfunk’s image My site equivalent image

  4. Click on back arrow to navigate all the way to the topmost navigation level Squidfunk’s image My site equivalent image

  5. Click outside the side menu to close it

  6. Expand window so that it returns to desktop layout

  7. Sidebar menu not visible anymore Squidfunk’s image My site equivalent image

Package versions

For my minimal project:

  • Python: 3.6.5 :: Anaconda, Inc.
  • MkDocs: 1.1
  • Material: 5.1.3

Project configuration

For my minimal project:

site_name: My Docs

theme: 
  name: 'material'
  features:
    - tabs

nav:
  - index.md
  - Extensions:
    - Admonitions: extensions/admonitions.md

System information

  • OS: Windows 10
  • Browsers:
    • Chrome Version 81.0.4044.122 (Official Build) (64-bit)
    • Firefox 74.0.1 (64-bit)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
squidfunkcommented, Apr 30, 2020

Released as part of 5.1.4

1reaction
squidfunkcommented, Apr 28, 2020

Okay, so, first I really want to thank you for providing such a detailed explanation, including the screenshots explaining the problem. It helped to understand the problem at hand. Also, thanks for taking the time to deploy the docs.

Then, I have to apologize for being too quick on that matter - I really thought there’s no easy fix, but we seem to have done it right in the beginning and at some point introduced the bug. For this reason, we can try to re-introduce the missing CSS and see, if this will fix the issues. The _tabs.scss has changed slightly as of v5, so the CSS might need to be a little different. My guess is, that the following CSS might fix it:

@media only screen and (min-width: 76.25em) {
  .md-tabs--active ~ .md-main .md-nav[data-md-level="1"] {
    display: block;
  }
}

If you’d like to take a shot at this yourself, you’re more than welcome to submit a PR 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page tree is missing in Space navigation sidebar and Space ...
After saving, Home Page field will be visible in the Overview tab and Space will have its page tree returned to the navigation...
Read more >
Fix sidenav on large screens not working - MDBootstrap
I am trying to setup my site exactly like the layout DOUBLE NAVIGATION WITH FIXED SIDENAV & FIXED NAVBAR. But no matter what...
Read more >
left-side sticky element disappears when scrolling to the right
I am trying to create a web page with five regions, three of them are sticky. The sticky feature works fine when the...
Read more >
This is really dumb, but my UI all disappeared and I don't know ...
Are you using 2.8 or 2.79? If you're using 2.8 you can delete the layout tab and make a new one, if you're...
Read more >
Scroll/Follow Sidebar, Multiple Techniques | CSS-Tricks
The easiest way to handle this is just to use CSS fixed positioning. Our sidebar is within a #page-wrap div with relative positioning,...
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