Skip to content

Commit

Permalink
MWPW-142084 - Accessibility: ARIA attribute needed on "Play" button f…
Browse files Browse the repository at this point in the history
…or Image video links (#2398)

* added conditional and style for items center

* remove console

* add area-label: play to image-video-link

* removed area-label from play-icon-container
  • Loading branch information
ryanmparrish authored Jun 4, 2024
1 parent 01a9b19 commit fe0adb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/utils/image-video-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export default function init(el, a, btnFormat) {
const playBtnFormat = btnFormat.split(':')[1];
const btnSize = playBtnFormat.includes('-') ? `btn-${playBtnFormat.split('-')[1]}` : 'btn-large';
const pic = el.querySelector('picture');
const playIcon = createTag('div', { class: 'play-icon-container', 'aria-label': 'play', role: 'button' }, PLAY_ICON_SVG);
const playIcon = createTag('div', { class: 'play-icon-container' }, PLAY_ICON_SVG);
const imgLinkContainer = createTag('span', { class: 'modal-img-link' });
el.insertBefore(imgLinkContainer, pic);
if (btnSize) a.classList.add(btnSize);
a.classList.add('consonant-play-btn');
a.setAttribute('aria-label', 'play');
a.append(playIcon);
imgLinkContainer.append(pic, a);
}

0 comments on commit fe0adb4

Please sign in to comment.