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

Prevent double readout of PM names, by a screenreader, in Dropin #2206

Merged
merged 1 commit into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/honest-cherries-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@adyen/adyen-web': patch
---

Prevent double readout of PM names, by a screenreader, in Dropin.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ class PaymentMethodItem extends Component<PaymentMethodItemProps> {
aria-hidden="true"
/>

<PaymentMethodIcon altDescription={paymentMethod.props.name} type={paymentMethod.type} src={paymentMethod.icon} />
<PaymentMethodIcon
// Only add alt attribute to storedPaymentMethods (to avoid SR reading the PM name twice)
{...(paymentMethod.props.oneClick && { altDescription: paymentMethod.props.name })}
type={paymentMethod.type}
src={paymentMethod.icon}
/>

<PaymentMethodName
displayName={paymentMethod.displayName}
Expand Down