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-164131: Adding aria label for CTA using placeholder on name attributes of merch card #3505

Open
wants to merge 18 commits into
base: stage
Choose a base branch
from
Open
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions libs/blocks/merch-card/merch-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,5 +706,10 @@ export default async function init(el) {
}
el.replaceWith(merchCard);
decorateMerchCardLinkAnalytics(merchCard);
const ctaLink = ctas?.querySelector('a');
if (merchCard.name && ctaLink) {
const { replaceKey } = await import('../../features/placeholders.js');
await replaceKey(merchCard.name, getConfig()).then((key) => ctaLink.setAttribute('aria-label', `${ctaLink.textContent} ${key}`));
seanchoi-dev marked this conversation as resolved.
Show resolved Hide resolved
}
return merchCard;
}
Loading