Skip to content

Commit

Permalink
small a11y improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
m1aw committed Aug 27, 2024
1 parent 41f8a3b commit c4da5cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-crabs-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@adyen/adyen-web': patch
---

Improves acessibility removing region on payment method item and button loading state
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class PaymentMethodItem extends Component<PaymentMethodItemProps> {
</div>

<div className="adyen-checkout-pm-details-wrapper" aria-hidden={!isSelected}>
<div className="adyen-checkout__payment-method__details" id={containerId} role="region">
<div className="adyen-checkout__payment-method__details" id={containerId}>
{showRemovePaymentMethodButton && (
<DisableOneClickConfirmation
id={disableConfirmationId}
Expand Down
9 changes: 7 additions & 2 deletions packages/lib/src/components/internal/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ class Button extends Component<ButtonProps, ButtonState> {
const buttonClasses = classNames(['adyen-checkout__button', ...modifiers.map(m => `adyen-checkout__button--${m}`)]);

const buttonStates = {
loading: <Spinner size="medium" />,
loading: (
<span className="adyen-checkout__button__content">
<Spinner size="medium" inline />
{i18n.get('loading')}
</span>
),
redirect: (
<span className="adyen-checkout__button__content">
<Spinner size="medium" inline />
Expand All @@ -73,7 +78,7 @@ class Button extends Component<ButtonProps, ButtonState> {
}

return (
<button className={buttonClasses} type="button" disabled={disabled} onClick={this.onClick}>
<button className={buttonClasses} type="button" aria-disabled={disabled} onClick={this.onClick}>
{buttonText}
{status !== 'loading' && status !== 'redirect' && this.props.children}
</button>
Expand Down

0 comments on commit c4da5cb

Please sign in to comment.