Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-142084 - Accessibility: ARIA attribute needed on "Play" button for Image video links #2398

Merged
merged 5 commits into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
Loading