-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(radio-button): Prevent invalid/warn states when disabled/readonly #20810
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(radio-button): Prevent invalid/warn states when disabled/readonly #20810
Conversation
Fixed RadioButton components in both React and Web Components to not show invalid/warn states when in disabled or readonly state, as users cannot interact with these components in those states.
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20810 +/- ##
==========================================
+ Coverage 92.41% 92.42% +0.01%
==========================================
Files 515 515
Lines 37524 37591 +67
Branches 5693 5735 +42
==========================================
+ Hits 34676 34745 +69
+ Misses 2700 2697 -3
- Partials 148 149 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
riddhybansal
left a comment
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.
Hi This Looks God to me!! Thanks for your contribution 💯
riddhybansal
left a comment
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.
Hey this looks good
Small Suggestions for Improvement
Code Consistency
Consider using useNormalizedInputProps in all components rather than creating separate validation logic:
normalizedProps = useNormalizedInputProps({
id, disabled, readOnly, invalid, invalidText, warn, warnText,
});
Then reference normalizedProps.invalid and normalizedProps.warn for validation states
Our input controls already use this pattern, which makes future fixes simpler (just update the hook once).
Here is the reference #20808
Fixed Timepicker components in both React and Web Components to not show invalid/warn states when in disabled or readonly state, as users cannot interact with these components in those states.
Hi @riddhybansal these changes are done. Could you please review . Also can you please add the label hacktoberfest to this PR. |
|
Please run "yarn test -u" in root for test cases to pass. |
@riddhybansal Ran the tests in local and passed |
b1d5ecd

Fixed RadioButton components in both React and Web Components to not show invalid/warn states when in disabled or readonly state, as users cannot interact with these components in those states.
Closes #20730
Changelog
Changed
Testing / Reviewing
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
More details can be found in the pull request guide