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

Revert "Revert the Button's disabled state (#2340)" #2351

Merged
merged 1 commit into from
Dec 19, 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
2 changes: 1 addition & 1 deletion .changeset/cold-buses-fail.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@sumup/circuit-ui': minor
'@sumup/circuit-ui': major
---

Changed the NotificationInline's action from the Button to the Anchor component. Update the action props if necessary.
2 changes: 1 addition & 1 deletion .changeset/old-schools-walk.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@sumup/circuit-ui': minor
'@sumup/circuit-ui': major
---

Changed the default size of the CloseButton from 40px to 48px to match the Button component.
5 changes: 5 additions & 0 deletions .changeset/orange-squids-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/circuit-ui': major
---

Improved the accessibility of disabled Buttons. The `disabled` attribute has been replaced with the `aria-disabled` attribute which enables the disabled element to receive focus and be perceived by screenreader users. Interactions with the disabled element are blocked by a dummy click handler.
3 changes: 0 additions & 3 deletions packages/circuit-ui/components/Button/base.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@
.base[disabled],
.base[aria-disabled="true"] {
color: var(--cui-fg-normal-disabled);

/* TODO: Remove in the next major version */
pointer-events: none;
cursor: not-allowed;
background-color: var(--cui-bg-highlight-disabled);
border-color: transparent;
Expand Down
2 changes: 0 additions & 2 deletions packages/circuit-ui/components/Button/base.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ describe('Button', () => {

const button = screen.getByRole('button');

expect(button).toBeDisabled();
expect(button).toHaveAttribute('aria-disabled', 'true');
});

Expand All @@ -81,7 +80,6 @@ describe('Button', () => {

const button = screen.getByRole('button');

expect(button).toBeDisabled();
expect(button).toHaveAttribute('aria-disabled', 'true');
});

Expand Down
4 changes: 0 additions & 4 deletions packages/circuit-ui/components/Button/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ export function createButtonComponent<Props>(
'aria-live': 'polite',
'aria-busy': Boolean(isLoading),
})}
// TODO: Remove in the next major version
{...(!isLink && {
disabled: isDisabled,
})}
{...(isDisabled && {
'aria-disabled': true,
})}
Expand Down