Skip to content

Commit

Permalink
Adding back some original elements and properties to prevent block va…
Browse files Browse the repository at this point in the history
…lidation issues, as this is just a temporary fix
  • Loading branch information
coder-karen committed Jan 3, 2025
1 parent baa5e86 commit 96dbbfb
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,23 @@ class GalleryImageEdit extends Component {
src={ isTransient ? undefined : url }
srcSet={ isTransient ? undefined : srcSet }
style={ isTransient ? { backgroundImage: `url(${ origUrl })` } : undefined }
tabIndex="0"
aria-label={ ariaLabel }
/>
{ isTransient && <Spinner /> }
</Fragment>
);

return (
// The image itself is not meant to be interactive, but the enclosing element should be.
<div
<figure
className={ clsx( 'tiled-gallery__item', {
'is-selected': isSelected,
'is-transient': isTransient,
[ `filter__${ imageFilter }` ]: !! imageFilter,
} ) }
tabIndex="0"
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
role="button"
onClick={ this.onImageClick }
onKeyDown={ this.onImageKeyDown }
Expand Down Expand Up @@ -153,7 +156,7 @@ class GalleryImageEdit extends Component {
</div>
{ /* Keep the <a> HTML structure, but ensure there is no navigation from edit */ }
{ href ? <a aria-hidden="true">{ img }</a> : img }
</div>
</figure>
);
}
}
Expand Down

0 comments on commit 96dbbfb

Please sign in to comment.