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

fix: Undo Breaking Change by re-allowing disabled prop on button #8462

Conversation

Philzen
Copy link
Contributor

@Philzen Philzen commented Apr 24, 2024

📝 Description

Closes #7269
Closes #7816
Closes #7905

Also re-enables the only currently known workaround for the accessibility problem described in #7965.

Removing the ability to use the disabled-prop posed a breaking change, which is hereby fixed.

⛳️ Current behavior (updates)

Despite the disabled prop being exposed in the type system, any value given will be discarded and overwritten by isDisabled || isLoading.

🚀 New behavior

Values given to disabled-prop are now respected again.

One use case (which was possible in 1.x up until 2.0.15) is the combination of isLoading disabled={false} to ensure that a button does not lose focus while in loading-state.

💣 Is this a breaking change (Yes/No):

This reverts a breaking change.

📝 Additional Information

This closes #7907, effectively replacing it.

This reverts commit 0f37665.

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

changeset-bot bot commented Apr 24, 2024

🦋 Changeset detected

Latest commit: 983650a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@chakra-ui/react Patch
@chakra-ui/test-utils Patch
@chakra-ui/docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
chakra-ui-storybook ✅ Ready (Inspect) Visit Preview May 8, 2024 6:01pm
chakra-ui-website ✅ Ready (Inspect) Visit Preview May 8, 2024 6:01pm

@Philzen
Copy link
Contributor Author

Philzen commented Apr 27, 2024

@segunadebayo Kindly have a look. This reverts a breaking change in v2 that affected quite a lot of users, see linked issues for reference.

Speaking for our team: we have an application that we'd love to update to v2 to bring it in line with React 18, however we cannot upgrade as it would break accessibility of toggle buttons losing their focus when isLoading={true} and using the disabled prop is the only current workaround we know of.

On a side note, I haven't reviewed the state machine config for buttons in zagjs, so i'm just referencing #7724 and #7965 for your attention, which may get solved in v3. Really thrilled about zag+ark btw 🚀

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants