-
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
[Bug]: Combobox fires its onInputChange callback on initial render #16969
Comments
One more issue with ComboBox, when an item is selected, and you try to clear it out by clicking (x) icon, it doesn't get cleared. |
I am having problems with the same issue here, where This is my own description and importance of resolving this issue. I hope that it helps bump up the priority/severity so that it can get the attention it needs to get resolved. When using Also note, since we're using Normally (with all other carbon components), event change handler functions are not triggered on initial load, because our local state value is already set properly and providing the value to In a simple use case (like the example code provided) it may not seem like an issue, but the problem is that it affects real life applications where scenarios are more dynamic. Such as, the initial value is dynamically determined programmatically, and the event handler Not sure if I described clearly, I don't want to make it sound like we're pushing our code problem to the UI library.. but the big impact is, because react is constantly looping through it's react cycles, and the initial load triggering Similar reproduction: Load the above page example
![]() |
Package
@carbon/react
Browser
Chrome, Safari, Firefox
Package version
v1.61.0
React version
16.14.0
Description
When a combobox first renders, the onInputChange callback fires. Shouldn't the onInputChange only fire when the user has typed a new value into the text box.
sample: https://codesandbox.io/s/staging-sea-r87r62?file=/src/index.js:737-750
Notice on render, the console tab shows the onInputChange fires
Reproduction/example
https://codesandbox.io/s/staging-sea-r87r62?file=/src/index.js:737-750
Steps to reproduce
Open this app: https://codesandbox.io/s/staging-sea-r87r62?file=/src/index.js:737-750
Look at the debug console to confirm the console.log state fires showing the callback was triggered.
Suggested Severity
None
Application/PAL
Event Integration (EEM)
Code of Conduct
The text was updated successfully, but these errors were encountered: