-
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: stopped onChange
throwing undefined
#18452
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ 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!
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 #18452 +/- ##
=======================================
Coverage 84.16% 84.16%
=======================================
Files 408 408
Lines 14449 14450 +1
Branches 4696 4647 -49
=======================================
+ Hits 12161 12162 +1
Misses 2124 2124
Partials 164 164 ☔ View full report in Codecov by Sentry. |
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.
looks good to me!
Closes #18286
Closes #18361
This PR resolves two things:
onChange
from getting called again when an already selected item is selected again.onChange
from throwingundefined
.Changelog
Changed
!isEqual(selectedItemProp, newSelectedItem)
to the keyboard event handler inside theonStateChange
to make sure we don't call theonChange
even when we select the same item.Testing / Reviewing