]> Untitled Git - lemmy-ui.git/commitdiff
Add title to pictrs-image
authorZetaphor <Zetaphor@users.noreply.github.com>
Tue, 13 Jun 2023 17:24:15 +0000 (12:24 -0500)
committerGitHub <noreply@github.com>
Tue, 13 Jun 2023 17:24:15 +0000 (12:24 -0500)
This adds a title tag to images, uses the alt tag value. This improves accessibility for sighted users and screen readers.

src/shared/components/common/pictrs-image.tsx

index 0b3493b5028d2904b4fa3dc12ed1f89d4334432c..27d1cc5fcf79cbd5e6b1bfe451a3df020dec7aac 100644 (file)
@@ -29,6 +29,7 @@ export class PictrsImage extends Component<PictrsImageProps, any> {
         <img
           src={this.props.src}
           alt={this.alt()}
+          title={this.alt()}
           loading="lazy"
           className={classNames({
             "img-fluid": !this.props.icon && !this.props.iconOverlay,