Skip to content

Commit 3bc78ae

Browse files
committed
Revert "allow DOM pass-through of aria-disabled on Button"
This reverts commit a3955f4.
1 parent 9e584b6 commit 3bc78ae

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

packages/@react-types/button/src/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ export interface LinkButtonProps<T extends ElementType = 'button'> extends AriaB
4747
}
4848

4949
interface AriaBaseButtonProps extends FocusableDOMProps, AriaLabelingProps {
50-
/** Indicates whether the element is disabled to users of assistive technology. */
51-
'aria-disabled'?: boolean | 'true' | 'false',
5250
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
5351
'aria-expanded'?: boolean | 'true' | 'false',
5452
/** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */

packages/react-aria-components/src/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const Button = /*#__PURE__*/ createHideableComponent(function Button(prop
147147
ref={ref}
148148
aria-labelledby={ariaLabelledby}
149149
slot={props.slot || undefined}
150-
aria-disabled={isPending ? 'true' : (buttonProps['aria-disabled'])}
150+
aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}
151151
data-disabled={props.isDisabled || undefined}
152152
data-pressed={renderValues.isPressed || undefined}
153153
data-hovered={isHovered || undefined}

packages/react-aria-components/test/Button.test.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,6 @@ describe('Button', () => {
5757
expect(button).toHaveAttribute('aria-current', 'page');
5858
});
5959

60-
it('should not have aria-disabled defined by default', () => {
61-
let {getByRole} = render(<Button>Test</Button>);
62-
let button = getByRole('button');
63-
expect(button).not.toHaveAttribute('aria-disabled');
64-
});
65-
66-
it('should support aria-disabled passthrough', () => {
67-
let {getByRole} = render(<Button aria-disabled="true">Test</Button>);
68-
let button = getByRole('button');
69-
expect(button).toHaveAttribute('aria-disabled', 'true');
70-
});
71-
7260
it('should support slot', () => {
7361
let {getByRole} = render(
7462
<ButtonContext.Provider value={{slots: {test: {'aria-label': 'test'}}}}>

0 commit comments

Comments
 (0)