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
Content tab indicator line displays incorrectly after reload #3744
Comments
Note: This issue was first identified by @2bndy5 |
Its much easier to re-produce in Firefox:
Initially, I thought this was a problem with my install, but I didn't realize the docs here are on the insider releases. |
Thanks for reporting. This appears to apply to the community, as well as Insiders edition. |
Fixed in 6976b9f. Tricky stuff. The interesting fact is that when going back, the browser will set the active tab to the previous tab asynchronously, which btw. is a nice side effect of leveraging form fields. Previous to this commit, the indicator was always set to the first tab on load. Now, content tabs are mounted asynchronously (actually the first time I used the |
Thanks Martin! |
Released as part of 8.2.8. |
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
The JavaScript code responsible content tabs in the non-insiders version of the theme seems to assume that when the page is first loaded, the first tab will always be selected:
mkdocs-material/src/assets/javascripts/components/content/tabs/index.ts
Line 86 in 366a5ea
Expected behaviour
The indicator line below the tab label should always correspond to the selected tab.
Actual behaviour
In a number of cases the first tab may not be the initially selected one:
The result is that the indicator line is shown for the wrong element:
Steps to reproduce
Package versions
Configuration
This theme's own documentation.
System information
The text was updated successfully, but these errors were encountered: