fix(multiselect): Disallow invalid & warn when readonly or disabled#20806
Conversation
…stem#20724) fix multiselect to not show warning when component is disabled or readOnly.
…-design-system#20724) fix FilterableMultiSelect to not show warning when it is disabled or readOnly.
add test cases to not show warnings when disabled or readOnly.
…stem#20724) fix multiselect to not show warning when disabled or readOnly (web-components).
add test cases to not show warnings when disabled or readOnly.
fix multiselect to show helperText when is invalid but not interactive
✅ 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 #20806 +/- ##
==========================================
- Coverage 86.16% 86.12% -0.04%
==========================================
Files 535 535
Lines 41893 41909 +16
Branches 6522 6527 +5
==========================================
Hits 36096 36096
- Misses 5633 5649 +16
Partials 164 164
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.
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 PR
refactor slider to use the useNormalizedInputProps hook.
…uka/carbon into 20724-multiselect-warning
|
Done! Quick question: for the IBM hacktoberfest event we were requested to add a "hacktoberfest" label on the pull requests for easier tracking of what we made. Would that be possible? |
|
@alisonjoseph, @riddhybansal, the dropdown PR has been merged! 🎉 |
6cdbc1b
Closes #20724
Fix the behavior for MultiSelect and FilterableMultiSelect. When component is disabled or readOnly, it should not show warning nor invalid messages.
Changelog
Changed
Testing / Reviewing
(For react)
(For web-components)
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
Updated documentation and storybook examplesMore details can be found in the pull request guide