Skip to content

Commit 5ea9f54

Browse files
Fix duplicate PayPal screen reader announcement (#2655)
* Fix duplicate PayPal screen reader announcement by giving the smart button stack's iframe a distinct title (PayPal Payment Buttons) * removing unrelated trailing comma changes
1 parent 6afd3b4 commit 5ea9f54

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/zoid/buttons/component.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,16 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
231231
},
232232

233233
attributes: ({ props }) => {
234-
let fundingSource = "";
235-
if (props.fundingSource) {
236-
fundingSource = `-${props.fundingSource}`;
237-
}
234+
// avoid title colliding when no fundingSource is set
235+
const title = props.fundingSource
236+
? `${FUNDING_BRAND_LABEL.PAYPAL}-${props.fundingSource}`
237+
: `${FUNDING_BRAND_LABEL.PAYPAL} Payment Buttons`;
238238

239239
return {
240240
iframe: {
241241
allowpaymentrequest: "allowpaymentrequest",
242242
scrolling: "no",
243-
title: `${FUNDING_BRAND_LABEL.PAYPAL}${fundingSource}`,
243+
title,
244244
role: "presentation",
245245
},
246246
};

0 commit comments

Comments
 (0)