File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @patternfly/elements " : patch
3+ ---
4+ ` <pf-jump-links> ` : improve screen reader accessibility by labeling the navigation landmark element
Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ export class PfJumpLinks extends LitElement {
7272 /** Offset to add to the scroll position, potentially for a masthead which content scrolls under. */
7373 @property ( { type : Number } ) offset = 0 ;
7474
75- /** Label to add to nav element. */
76- @property ( ) label ?: string ;
75+ /** Label to add to nav element. Required for accessibility. */
76+ @property ( { reflect : true } ) label = 'Jump to section' ;
7777
7878 #kids = this . querySelectorAll ?.< LitElement > ( ':is(pf-jump-links-item, pf-jump-links-list)' ) ;
7979
@@ -121,11 +121,11 @@ export class PfJumpLinks extends LitElement {
121121
122122 render ( ) : TemplateResult < 1 > {
123123 return html `
124- < nav id ="container "> ${ this . expandable ? html `
124+ < nav id ="container " aria-labelledby =" label " > ${ this . expandable ? html `
125125 < details ?open ="${ this . expanded } " @toggle ="${ this . #onToggle} ">
126126 < summary >
127127 < pf-icon icon ="chevron-right "> </ pf-icon >
128- < span id ="label "> ${ this . label } </ span >
128+ < span part =" label " id ="label "> ${ this . label } </ span >
129129 </ summary >
130130 < div role ="listbox " aria-labelledby ="label ">
131131 < slot > </ slot >
You can’t perform that action at this time.
0 commit comments