Skip to content

Commit

Permalink
use cardheading instead label when they are same
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchoi-dev committed Jan 23, 2025
1 parent 8b0843d commit b1baae5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/blocks/merch-card/merch-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ export default async function init(el) {
if (productName) {
await replaceKey(productName, getConfig()).then((label) => {
const cardHeading = merchCard.querySelector('.card-heading')?.textContent;
const ariaLabel = label.toLowerCase() === cardHeading.toLowerCase() ? `${ctaLink.textContent} - ${label}` : `${ctaLink.textContent} - ${label} - ${cardHeading}`;
const ariaLabel = label.toLowerCase() === cardHeading.toLowerCase() ? `${ctaLink.textContent} - ${cardHeading}` : `${ctaLink.textContent} - ${label} - ${cardHeading}`;
ctaLink.setAttribute('aria-label', ariaLabel);
});
}
Expand Down

0 comments on commit b1baae5

Please sign in to comment.