New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The section may require two clicks for getting collapsed when the navigation.expand
feature is on.
#2386
The section may require two clicks for getting collapsed when the navigation.expand
feature is on.
#2386
Comments
I find the following modification would fix the bug. But I am not sure whether it is a correct solution and would not exert other issues: Change the template: {#-
This file was automatically generated - do not edit
-#}
{% macro render(nav_item, path, level) %}
{% set class = "md-nav__item" %}
{% if nav_item.active %}
{% set class = class ~ " md-nav__item--active" %}
{% endif %}
{% if nav_item.children %}
{% if "navigation.sections" in features and level == 1 + (
"navigation.tabs" in features
) %}
{% set class = class ~ " md-nav__item--section" %}
{% endif %}
<li class="{{ class }} md-nav__item--nested">
{% set checked = "checked" if nav_item.active %}
{% if "navigation.expand" in features and not checked %}
- <input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" data-md-state="indeterminate" type="checkbox" id="{{ path }}" checked>
+ <input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" checked>
{% else %}
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" {{ checked }}>
{% endif %}
<label class="md-nav__link" for="{{ path }}"> In my explanation, the bug is triggered by the following reason.
I do not know why you need to set it |
Thanks for reporting! That's indeed a bug. The problem originates from the fact that when clicking on a checkbox with state |
Fixed in f05c34e. |
Dear author, Wow, you are quite efficient. Thank you! cainmagi |
Released as 7.0.4. |
I am sorry to find that after the new version updated, although the bug of double clicks gets fixed in desktop mode. The mobile view requires double clicks for expanding each section. I guess that this problem is caused by the following reason:
Certainly, the two behaviors conflict with each other. I suggest that we should render different navigation bars for desktop view and mobile view respectively. If we do that, we could benefit from:
Please consider this suggestion. I think implementing two navbars, and let them controlled by css would be easier to maintain the |
You're right! Thanks for reporting and re-opening. It's a tricky topic 😅 |
I think I've got a fix in 5d0cae7 – could you check the lastest |
I have checked it with my cell phone. It works well now. |
Dear author,
I've found a bug and checked that ...
Description
There is a bug in the following feature:
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:
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
At line 159
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
Project configuration
Please download the
mkdocs.yml
in the following link:mkdocs.zip
System information
The text was updated successfully, but these errors were encountered: