We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e628ef3 commit 26bad2aCopy full SHA for 26bad2a
packages/react/src/Button/Button.tsx
@@ -153,12 +153,6 @@ export const _Button = forwardRef(
153
[isDisabled, onBlur],
154
)
155
156
- let disabledProp
157
-
158
- if (isDisabled) {
159
- disabledProp = Component === 'button' ? {disabled: true} : {'aria-disabled': true}
160
- }
161
162
return (
163
<Component
164
ref={ref}
@@ -175,7 +169,8 @@ export const _Button = forwardRef(
175
169
onMouseLeave={handleOnMouseLeave}
176
170
onFocus={handleOnFocus}
177
171
onBlur={handleOnBlur}
178
- {...disabledProp}
172
+ disabled={(isDisabled && Component === 'button') || undefined}
173
+ aria-disabled={(isDisabled && Component !== 'button') || undefined}
179
174
style={{...animationInlineStyles, ...style}}
180
{...props}
181
>
0 commit comments