Add title to pictrs-image

This adds a title tag to images, uses the alt tag value. This improves accessibility for sighted users and screen readers.
This commit is contained in:
Zetaphor 2023-06-13 12:24:15 -05:00 committed by GitHub
parent 0d67c64af9
commit 31257b9dd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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