fix(select): disallow invalid and warn when readonly or disabled#20808
Conversation
|
All contributors have signed the DCO. |
✅ 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. |
prevent invalid and warn states from appearing when the Select component is disabled or readonly. applied updates to both React and Web Components implementations, and add corresponding unit tests
16b9175 to
ddb7849
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20808 +/- ##
==========================================
+ Coverage 85.09% 85.13% +0.04%
==========================================
Files 530 530
Lines 40877 40881 +4
Branches 6327 6298 -29
==========================================
+ Hits 34784 34806 +22
+ Misses 5933 5914 -19
- Partials 160 161 +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:
|
|
Thanks for contributing just the small update above!! |
…n-system#20812) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v5...v6) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…eadonly-or-disabled
…eadonly-or-disabled
…eadonly-or-disabled
…eadonly-or-disabled
…eadonly-or-disabled
e396e49
|
Hey there! v11.98.0 was just released that references this issue/PR. |
Closes #20725
Disallow invalid and warn when readonly or disabled in Select
Changelog
New
disabledorreadOnlyaretrue.Changed
Selectcomponents now use theuseNormalizedPropshook. This ensures all components apply a consistent logic to disallowinvalidandwarnstates from appearing whendisabledorreadonlyaretrue.normalizedProps. This aligns the WC with the React library's prop normalization logic, specifically to disallowinvalidandwarnstates whendisabledorreadOnlyaretrue.Removed
Testing / Reviewing
React Library
Selectcomponent stories.disabledprop totrue. Whiledisabledis true, set theinvalidprop totrueand confirm that the invalid styles/messages do not show up. Apply the same thing with thewarnprop.readOnlyprop totrue. WhilereadOnlyis true, set theinvalidprop totrueand confirm that the invalid styles/messages do not show up. Apply the same thing with thewarnprop.Web Component (WC)
Selectcomponent stories.disabledattribute totrue. Whiledisabledis true, set theinvalidattribute totrueand confirm that the invalid styles/messages do not show up. Apply the same thing with thewarnattribute.readOnlyattribute totrue. WhilereadOnlyis true, set theinvalidattribute totrueand confirm that the invalid styles/messages do not show up. Apply the same thing with thewarnattribute.Verify that the unit tests are passing, which confirms the correct behavior for
disabledandreadOnly.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