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.

The section may require two clicks for getting collapsed when the `navigation.expand` feature is on.

See original GitHub issue

Dear author,

I’ve found a bug and checked that …

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

Description

There is a bug in the following feature:

features:
  - navigation.expand

When this feature is on, the section (expanded in default) may require two clicks for getting collapsed.

Expected behavior

Every time I refresh the page, the expanded section should only require one click for collapsing.

Actual behavior

The bug is:

  • Although all items in the navbar are expanded. A section would not get collapse. It requires me to click it for the second time, then it would behave normally.
  • Such a bug would not exist if the section is the parent of the current page.

image

I guess that the bug exists in the JS codes, it may not take the expand case into consideration.

Steps to reproduce the bug

Please use your current repository, and change the mkdocs.yml like this:

At line 55

  features:
    # - navigation.instant
-   - navigation.sections
+   # - navigation.sections
    - navigation.tabs
+   - navigation.expand

At line 159

-   - Changing the fonts: setup/changing-the-fonts.md
-   - Changing the language: setup/changing-the-language.md
-   - Changing the logo and icons: setup/changing-the-logo-and-icons.md
-   - Setting up navigation: setup/setting-up-navigation.md
-   - Setting up site search: setup/setting-up-site-search.md
-   - Setting up site analytics: setup/setting-up-site-analytics.md
+   - Changing test:
+     - Changing the fonts: setup/changing-the-fonts.md
+     - Changing the language: setup/changing-the-language.md
+     - Changing the logo and icons: setup/changing-the-logo-and-icons.md
+   - Setting up test:
+     - Setting up navigation: setup/setting-up-navigation.md
+     - Setting up site search: setup/setting-up-site-search.md
+     - Setting up site analytics: setup/setting-up-site-analytics.md

The modified file is attached here:

mkdocs.zip

I am not very familiar with your theme. Please fix it if you have time. Thank you!

Package versions

  • Python: 3.7.1
  • MkDocs: 1.1.2
  • Material: 7.0.3

Project configuration

Please download the mkdocs.yml in the following link:

mkdocs.zip

System information

  • OS:

    • Edition: Windows 10 Home
    • Version: 20H2
    • Installed on: 12/‎15/‎2020
    • OS build: 19042.804
    • Experience: Windows Feature Experience Pack 120.2212.551.0
  • Browser: Chrome 88.0.4324.190

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
squidfunkcommented, Mar 4, 2021

Released as 7.0.4.

1reaction
cainmagicommented, Mar 4, 2021

Dear author,

Wow, you are quite efficient. Thank you!

cainmagi

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap collapse needs two clicks to open on a Joomla site
When you are clicking first time than this attribute gets added to the button aria-expanded="false". So the div gets collapsed, if expanded.
Read more >
Expand / Collapse folders in left navigation - Wrike Help Center
It would be super convenient to be able to expand or collapse all with one click.
Read more >
URL query string to expand collapsed section on page?
Yes, they just need to click the caret icon to expand it, but it'd be better if there were a way to modify...
Read more >
Video: Collapsible headings - Microsoft Support
The ability to collapse and expand content in your document is based on its outline level. You can quickly add an outline level...
Read more >
Expand, collapse, or show details in a PivotTable or PivotChart
Double -click the item that you want to expand or collapse. Right-click the item, click Expand/Collapse, and then do one of the following:...
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