The menu output includes the following tag:
<h2 class="visually-hidden" id="block-imp-main-menu-menu">Main navigation</h2>
The H2 headers ‘Main Navigation’ and ‘Secondary’ are visually hidden. But they are present in the main menu and therefore appear across the site on every page. They are not suitable keywords for SEO optimisation and should not have a H2 tag.
The H2 tag is required for accessibility but could be replaced with the following:
<div class="visually-hidden" role="heading" aria-level="2" id="block-mainnavigation-menu">Main navigation</div>
Additional Reference:
Bootstrap 5 documentation on accessibility:
https://getbootstrap.com/docs/5.0/getting-started/accessibility/
Accessible heading structure
https://www.a11yproject.com/posts/how-to-accessible-heading-structure/
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | after patch.png | 361.31 KB | dishakatariya |
| #9 | before patch.png | 374.24 KB | dishakatariya |
| #6 | after.png | 40.57 KB | rupeshghar |
| #6 | before.png | 38.73 KB | rupeshghar |
Issue fork bootstrap_barrio-3384625
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3384625-hidden-labels-in
changes, plain diff MR !73
Comments
Comment #2
sittard commentedComment #3
ravi kant commentedThe
aria-hidden="true"attribute can use instead using class 'visually-hidden'.Comment #6
rupeshghar commentedI have replaced the heading tag with division and added attributes role and aria-level. The visually-hidden class was not replace with aria-hidden=true attribute as it ll not be considered while screen reading
Comment #7
rupeshghar commentedComment #8
dishakatariya commentedComment #9
dishakatariya commentedHi,Verified and tested Issue with this Branch bootstrap_barrio-3384625 on the D10.X version with the Barrio Bootstrap 5 Theme
Version: 5.5.x-dev.
Testing steps-
1. Install the D10.x version
2. Install the theme 5.5.x version
3. Now Apply the patch and check for the hidden labels in the menu H2 tag has been removed by inspecting the element.
Testing Result
For the Hidden labels in menu an H2 tag is removed.
Attaching screenshot for reference.
Can be move to RTBC.
Thanks!
Comment #11
hatuhay commented