Skip to content

Commit

Permalink
fix: Undo Breaking Change by re-allowing disabled prop on button (#8462)
Browse files Browse the repository at this point in the history
* Revert "refactor: button disabled prop"

This reverts commit 0f37665.

Fixes #7269, #7816 and #7905 and also enables the only currently known
workaround for 	#7965. Removing the ability to use the disabled-prop
posed a breaking change, which is hereby fixed.

* docs: update

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
  • Loading branch information
Philzen and segunadebayo committed May 8, 2024
1 parent e3673f4 commit 938916a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nine-bags-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chakra-ui/react": patch
---

Revert breaking change by re-allowing disabled prop on button
2 changes: 1 addition & 1 deletion packages/components/src/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const Button = forwardRef<ButtonProps, "button">((props, ref) => {

return (
<chakra.button
disabled={isDisabled || isLoading}
ref={useMergeRefs(ref, _ref)}
as={as}
type={type ?? defaultType}
Expand All @@ -84,7 +85,6 @@ export const Button = forwardRef<ButtonProps, "button">((props, ref) => {
__css={buttonStyles}
className={cx("chakra-button", className)}
{...rest}
disabled={isDisabled || isLoading}
>
{isLoading && spinnerPlacement === "start" && (
<ButtonSpinner
Expand Down

0 comments on commit 938916a

Please sign in to comment.