8000 The section may require two clicks for getting collapsed when the `navigation.expand` feature is on. · Issue #2386 · squidfunk/mkdocs-material · GitHub
[go: up one dir, main page]

Skip to content

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

@cainmagi

Description

@cainmagi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0