feat: Added Checkbox behavior to not show invalid / warn when readOnly / disabled#20804
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20804 +/- ##
==========================================
- Coverage 94.93% 94.91% -0.02%
==========================================
Files 541 541
Lines 45256 45289 +33
Branches 6336 6352 +16
==========================================
+ Hits 42963 42986 +23
- Misses 2161 2171 +10
Partials 132 132
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:
|
There was a problem hiding this comment.
Hello, thanks for contributing!
We recommend utilizing the internal useNormalizedInputProps to achieve this functionality
Some example usage and the associated PR
|
Hi @maradwan26 will fix that. Thanks. |
|
@FFahrenheit thanks for contributing! It seems the web components tests are failing, could you check this? |
|
Hey @maradwan26 @riddhybansal, could you recheck this PR? I made some updates and want to confirm everything looks okay. Thanks!! |
There was a problem hiding this comment.
LGTM! Thanks @heloiselui, just added a commit to update the dates
Co-authored-by: Mahmoud <132728978+maradwan26@users.noreply.github.com>
27f2292
…y / disabled (carbon-design-system#20804) * fix: disable invalid / warn on readOnly / disabled Checkbox carbon-design-system#20728 * fix: disable invalid / warn on readOnly / disabled Checkbox (WC) carbon-design-system#20728 * feat: invalid / warn on disabled tests carbon-design-system#20728 * fix: storybook wc changes * fix(checkbox): normalize checkbox in react * test(checkbox): add tests * fix(checkbox): normalize checkbox in wc * test(checkbox): add tests in wc * Apply suggestions from code review Co-authored-by: Mahmoud <132728978+maradwan26@users.noreply.github.com> --------- Co-authored-by: Heloise Lui <71858203+heloiselui@users.noreply.github.com> Co-authored-by: Riddhi Bansal <41935566+riddhybansal@users.noreply.github.com> Co-authored-by: “heloiselui” <helolui27@gmail.com> Co-authored-by: Mahmoud <132728978+maradwan26@users.noreply.github.com>
Closes #20728
Disabled invalid / warning states on Checkbox and CheckboxGroup when
readOnlyordisabledproperty is set (React + Web Components)Changelog
New
Changed
readOnlyand notdisabled)readOnly/disabledTesting / Reviewing
Go to React | WC Deploy Preview > Checkbox > Default
Test Disabled State: Set the
disabledprop to true. Whiledisabled is true, set theinvalid prop to trueand confirm that the invalid styles/messages do not show up. Apply the same thing with the warn prop.Test ReadOnly State: Set the
readOnlyprop to true. WhilereadOnly is true, set theinvalid prop to trueand confirm that the invalid styles/messages do not show up. Apply the same thing with the warn prop.PR Checklist
As the author of this PR, before marking ready for review, confirm you:
[ ] Updated documentation and storybook examples[ ] Addressed any impact on accessibility (a11y)More details can be found in the pull request guide