fix(slider): Disallow invalid & warn when readonly or disabled#20784
Conversation
…20731) fix slider to not show warning message when component is disabled or readOnly.
add test cases to not show warnings when disabled or readOnly.
|
All contributors have signed the DCO. |
|
I have read the DCO document and I hereby sign the DCO. |
✅ 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. |
There was a problem hiding this comment.
Hey, thanks for doing this.
This looks great just few changes I feel that needs to be address.
Variable Naming:
Consider renaming isCurrentlyEditable to isInteractive (preferred) or isEditableState.
Additional Test Cases:
Please add tests to verify:
- Should not set aria-invalid when disabled with invalid/warn prop
- Should not set aria-invalid when readOnly with invalid/warn prop
Consider doing same fix for web-component as well.
change variable name from "isCurrentlyEditable" to "isInteractive".
|
Thanks for the feedback! |
|
Can you please do the same fix for the web-component slider as well. |
✅ Deploy Preview for v11-carbon-web-components ready!
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 #20784 +/- ##
==========================================
- Coverage 92.46% 92.33% -0.14%
==========================================
Files 508 511 +3
Lines 35753 37244 +1491
Branches 5673 5668 -5
==========================================
+ Hits 33058 34388 +1330
- Misses 2550 2709 +159
- Partials 145 147 +2
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:
|
fix slider to not show warning message when component is disabled or readOnly.
…arbon into 20731-slider-warning
|
Done! |
Yeah we are working on creating test files for all components for web-components. We have a whole of an epic for that you can go ahead and add test file for slider and add these test cases in it. |
add test cases to not show warnings when disabled or readOnly (web-components).
|
Ok! |
riddhybansal
left a comment
There was a problem hiding this comment.
Thanks for your contribution.
riddhybansal
left a comment
There was a problem hiding this comment.
Can you please add these test cases
Please add tests to verify:
Should not set aria-invalid when disabled with invalid/warn prop
Should not set aria-invalid when readOnly with invalid/warn prop
improve tests for two handle slider to check for data-invalid prop.
refactor slider to use the useNormalizedInputProps hook.
…arbon into 20731-slider-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? |
Thank you !! That is just perfect !! |
bc87e48
Closes #20731
Fix the behavior for Slider and Two Handle Slider. When component is disabled or readOnly, it should not show waning nor invalid message.
Changelog
Changed
Testing / Reviewing
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