-
Notifications
You must be signed in to change notification settings - Fork 54
Set appropriate disabled attribute on Button depending on rendered HTML element #1102
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
Conversation
🦋 Changeset detectedLatest commit: 26bad2a The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
🟢 No design token changes found |
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
cb9c816
to
0999b49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Button component to automatically set the appropriate disabled attribute based on the rendered HTML element type. Button elements use the disabled
attribute while other elements (like links) use the aria-disabled
attribute.
Key changes:
- Modified Button component logic to conditionally set disabled attributes based on element type
- Added comprehensive test coverage for various disabled states and element types
- Added changeset documentation for the breaking change
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/react/src/Button/Button.tsx | Updated component logic to conditionally set disabled/aria-disabled attributes based on element type |
packages/react/src/Button/Button.test.tsx | Added comprehensive test cases covering disabled states for button and link elements |
.changeset/warm-meals-learn.md | Added changeset documentation for the minor version update |
Comments suppressed due to low confidence (1)
packages/react/src/Button/Button.tsx:156
- [nitpick] The variable name
disabledProp
could be more descriptive. Consider renaming it todisabledAttributes
ordisabledProps
to better reflect that it contains an object with disabled-related attributes.
let disabledProp
0999b49
to
907d74d
Compare
907d74d
to
e611ed6
Compare
851d025
to
c287854
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-emptively approving, but there's some feedback on the changeset I'd love your thoughts on @joshfarrant
Summary
Updated the
Button
component to set the appropriate disabled attribute depending on the type of element rendered, e.g.What should reviewers focus on?
Steps to test
disabled
attribute and a link exclusively usesaria-disabled
.Supporting resources (related issues, external links, etc)
Contributor checklist
update snapshots
label to the PR)Reviewer checklist