File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,16 +119,12 @@ export default class SplitText {
119119 }
120120 }
121121
122- if ( ! this . options . noAriaLabel ) {
122+ if ( ! this . options . noAriaLabel && ( byChars || byWords ) ) {
123123 this . recursiveAriaLabel ( element ) ;
124124
125125 // 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 ) ;
132128 }
133129 } ) ;
134130
@@ -552,7 +548,6 @@ export default class SplitText {
552548 const line = document . createElement ( 'span' ) ;
553549 line . style . setProperty ( 'display' , 'block' ) ;
554550 line . className = 'line' ;
555- // line.setAttribute('aria-hidden', true);
556551 return parent ? parent . appendChild ( line ) : line ;
557552 }
558553
You can’t perform that action at this time.
0 commit comments