-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix(time-picker): prevent invalid/warn states when disabled/readonly #20818
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(time-picker): prevent invalid/warn states when disabled/readonly #20818
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 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 #20818 +/- ##
==========================================
+ Coverage 92.33% 92.39% +0.06%
==========================================
Files 511 511
Lines 37341 37352 +11
Branches 5677 5747 +70
==========================================
+ Hits 34478 34511 +33
+ Misses 2715 2692 -23
- 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:
|
✅ 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. |
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.
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).
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.
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.
1156df0 to
cdf64c8
Compare
|
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.
Thanks for doing this !! This looks perfect now.
fb1ec8c
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.
Closes #20727
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