File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -119,16 +119,12 @@ export default class SplitText {
119
119
}
120
120
}
121
121
122
- if ( ! this . options . noAriaLabel ) {
122
+ if ( ! this . options . noAriaLabel && ( byChars || byWords ) ) {
123
123
this . recursiveAriaLabel ( element ) ;
124
124
125
125
// Handle A tags
126
- const aTags = toArray ( element . getElementsByTagName ( 'A' ) ) ;
127
- aTags . forEach ( ( aTag ) => {
128
- if ( ! aTag . getAttribute ( 'aria-label' ) ) {
129
- aTag . setAttribute ( 'aria-label' , aTag . textContent ) ;
130
- }
131
- } ) ;
126
+ const focusableTags = toArray ( element . querySelectorAll ( 'a, button' ) ) ;
127
+ focusableTags . forEach ( this . createAriaLabel ) ;
132
128
}
133
129
} ) ;
134
130
@@ -552,7 +548,6 @@ export default class SplitText {
552
548
const line = document . createElement ( 'span' ) ;
553
549
line . style . setProperty ( 'display' , 'block' ) ;
554
550
line . className = 'line' ;
555
- // line.setAttribute('aria-hidden', true);
556
551
return parent ? parent . appendChild ( line ) : line ;
557
552
}
558
553
You can’t perform that action at this time.
0 commit comments