Skip to content
Closed
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/forty-cars-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Adds the `disabled` attribute to disabled `UnstyledButton` components to prevent them from being inadvertently selected by `button:not(:disabled)` CSS selectors.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export function UnstyledButton({
<button
{...interactiveProps}
aria-disabled={disabled}
disabled={disabled}
type={submit ? 'submit' : 'button'}
aria-busy={loading ? true : undefined}
aria-controls={ariaControls}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ describe('<Button />', () => {
const button = mountWithApp(<UnstyledButton disabled />);
expect(button).toContainReactComponent('button', {
'aria-disabled': true,
disabled: true,
});
});

Expand Down