File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,16 @@ export default async function decorate(block) {
105105 if ( pageHeaderData . anchorNode ) {
106106 const wrappingAnchor = document . createElement ( "a" ) ;
107107 wrappingAnchor . setAttribute ( "href" , anchorHref ) ;
108- // Remove from tab order and hide it from assistive tech; avoid repeating the title for screen readers.
109- wrappingAnchor . setAttribute ( "tabindex" , "-1" ) ;
110- wrappingAnchor . setAttribute ( "aria-hidden" , "true" ) ;
108+
109+ // Give the link a proper accessible name.
110+ wrappingAnchor . setAttribute ( "aria-label" , pageHeaderData . altText ? pageHeaderData . altText : pageHeaderData . title ) ;
111+
112+ // Treat image as decorative. It is already described by the adjacent text.
113+ const imgElement = pageHeaderVisual . querySelector ( 'img' ) ;
114+ if ( imgElement ) {
115+ imgElement . setAttribute ( "alt" , "" ) ;
116+ }
117+
111118 wrappingAnchor . append ( pageHeaderVisual ) ;
112119 pageHeaderVisual = wrappingAnchor ;
113120 }
You can’t perform that action at this time.
0 commit comments