Mkdocs-material: Current tab detection breaks if the section has only subsections

Created on 9 Dec 2020  Â·  6Comments  Â·  Source: squidfunk/mkdocs-material

__I've found a bug and checked that ...__

  • [x] ... the problem doesn't occur with the default MkDocs template
  • [x] ... 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

If tabbed navigation is enabled and a tab's nav items include only subsections, not any pages, then the tab may not be detected as active.

Expected behavior

The current tab is highlighted
(which it is in this case, but only for the first subsection)

image

Actual behavior

Selecting any item under the 2nd section onwards makes the tab not highlighted anymore

image

Steps to reproduce the bug

mkdir -p docs/taba docs/taba/bar docs/taba/foo docs/tabb
touch docs/taba/bar/bar.md docs/taba/bar/barr.md docs/taba/foo/foo.md docs/taba/foo/fooo.md docs/tabb/b.md                                                                                    
cat >mkdocs.yml

Package versions

Project configuration

site_name: Hmm
theme:
  name: material
  features:
    - navigation.tabs

System information

  • Browser: Firefox and Chromium
bug fix available

All 6 comments

Thanks for reporting! As with #2060 and #2072, it makes the most sense to revisit and solve this problem when the new navigation features are merged into master.

This issue has been resolved as part of #2072. As https://github.com/squidfunk/mkdocs-material/issues/2072#issuecomment-744011149 explains, the bugfix will be released with the hit of the next Insiders funding goal. This is an exception to the usual policy of providing bugfixes for both editions, due to the fact that navigation has undergone a big refactoring. As I'd consider this to be a minor bug (i.e. wrong link color), it doesn't justify the effort of backporting the fix. I hope for your understanding - it shouldn't take more than a few weeks after all.

The funding goal has been reached and the respective features and fixes have just been merged from Insiders. The master is already up to date - watch out for a release.

This is indeed fixed, thanks.
I would close this issue but not sure if that's the process that you're following.

I'm still trying to figure out whether we should start with a beta release – we'll close this issue when the fix is released.

6.2.1 was just released, which includes the fixes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madrus picture madrus  Â·  3Comments

michael-nok picture michael-nok  Â·  3Comments

HerbFargus picture HerbFargus  Â·  4Comments

NJAldwin picture NJAldwin  Â·  3Comments

nikramakrishnan picture nikramakrishnan  Â·  3Comments