fix: NumberInput react controlled vs uncontrolled handling#22139
Conversation
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-web-components 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 #22139 +/- ##
==========================================
- Coverage 95.13% 95.10% -0.03%
==========================================
Files 549 549
Lines 45642 45644 +2
Branches 6526 6556 +30
==========================================
- Hits 43423 43412 -11
- Misses 2089 2102 +13
Partials 130 130
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:
|
adamalston
left a comment
There was a problem hiding this comment.
Hmm, none of the checklist items are marked as complete, but this pull request is not in draft status. What is the expectation here?
After opening the PR, I reviewed the tests and stories to see if they could be reorganized for better clarity around this intention. I’ll move it to draft for now. |
|
@adamalston this is ready for a review. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
3646d8a
|
Hey there! v11.107.0 was just released that references this issue/PR. |
Closes #22138
properly differentiates the responsibilities of
value,defaultValue. to handlecontrolled,uncontrolledbehavoirs for number input.this may be a breaking change. but this behavior is wrong in the first place when i looked at the code.
what i believe is a standard is.
we have to make use of
defaultValue if the intention of the component usage is uncontrolled.
value if the intention is controlled.
references (external, try to check the component behaviors in this example)
https://stackblitz.com/edit/1zghp4qj?file=src%2FDemo.tsx
Changelog
Changed
Testing / Reviewing
corresponding controlled tests are added, and they should pass
for manual testing the stackblitz reproduction can be added in a test story and checked.
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