Skip to content

Commit

Permalink
adding the alt property to avatar images for accessibility metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
OvidijusParsiunas committed Nov 10, 2024
1 parent 8423d0d commit 3084d7b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions component/src/views/chat/messages/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class Avatar {
avatar.src = avatars?.[role]?.src || avatars?.ai?.src || avatars?.default?.src || aiLogoUrl;
}
avatar.classList.add('avatar');
avatar.alt = `${role} avatar`;
const avatarContainer = document.createElement('div');
avatarContainer.classList.add(Avatar.CONTAINER_CLASS);
avatarContainer.appendChild(avatar);
Expand Down

0 comments on commit 3084d7b

Please sign in to comment.