-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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(combobox): onInputChange calls #18713
base: main
Are you sure you want to change the base?
Conversation
* Remove useEffect calling onInputChange on initial render * Leverage useCombobox's onStateChange to call onInputChange * Unit tests
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #18713 +/- ##
=======================================
Coverage 84.34% 84.34%
=======================================
Files 408 408
Lines 14645 14646 +1
Branches 4791 4824 +33
=======================================
+ Hits 12352 12353 +1
Misses 2131 2131
Partials 162 162 ☔ View full report in Codecov by Sentry. |
Hey @Neues, setting up a test story would help us to test the fix. Could you do that please?? |
No problem @Gururajj77, comment updated with instructions. |
Closes #16969
Fix defect in ComboBox causing onInputChange to be called on initial render.
Changelog
Changed
onInputChange
on initial renderonStateChange
to callonInputChange
. Note that they provide onInputValueChange. They advise to use this only when inputValue is controlled, and in our case, we only are providing the callback. Therefore I think it is ok to handle this inonStateChange
.Testing/Reviewing
Observing Defect:
on
main
branch, addonInputChange
prop todefault
ComboBox inComoboBox.stories.js
ie, line 192
run storybook
http://localhost:3001/?path=/story/components-combobox--default
confirm that log shows up in console on initial render
Observing fix:
repeat steps above and confirm onInputChange is not called on initial render, and is only called on input change