a11y: remove role navigation from facetwp pager#15
Merged
Conversation
WybeBosch
approved these changes
Dec 11, 2025
Comment on lines
+100
to
+111
| /** | ||
| * A11y: remove 'role=navigation' from FacetWP pager if it is inside a <nav> element. | ||
| */ | ||
| private removeRoleNavigationFromPager(): void { | ||
| const pager = document.querySelector( '.facetwp-pager' ); | ||
| if ( ! pager ) return; | ||
|
|
||
| if ( pager.parentElement?.tagName.toLowerCase() === 'nav' ) { | ||
| pager.removeAttribute( 'role' ); | ||
| } | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Ahh right hier had je JS nodig omdat facetwp zelf die "role" zette. Helder.
a9e65e6 to
36cccff
Compare
YvetteNikolov
approved these changes
Dec 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tekst uit het a11y rapport:
De paginering is opgebouwd met behulp van een lijststructuur (ul- en li-elementen). Dit is op zichzelf een correcte en toegankelijke manier om een reeks navigatieopties weer te geven. In dit geval is echter de rol van het ul-element aangepast naar “navigation” via het role-attribuut. Door het toevoegen van deze rol breekt de semantische waarde van lijst en kan deze niet als dergelijk worden geïnterpreteerd door hulpsoftware. Dit kan worden opgelost door gebruik te maken van een los nav-element buiten het ul element en het role-attribuut te verwijderen. Bij deze oplossing dient het nav-element te worden voorzien van een aria-label-attribuut met een waarde, zoals “Paginering”.
De role navigation voegt de facetwp javascript toe dus wij halen het er weer af.
Gerelateerde PR: yardinternet/brave-hooks#46