From fe0adb46988dffdf397b32532f443bf5405da829 Mon Sep 17 00:00:00 2001 From: Ryan Parrish Date: Tue, 4 Jun 2024 04:50:39 -0600 Subject: [PATCH] MWPW-142084 - Accessibility: ARIA attribute needed on "Play" button for 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 --- libs/utils/image-video-link.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/utils/image-video-link.js b/libs/utils/image-video-link.js index c3295c7209..ef3ac90976 100644 --- a/libs/utils/image-video-link.js +++ b/libs/utils/image-video-link.js @@ -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); }