-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Jspurlin/combo box focus fix 7.0 #15784
Jspurlin/combo box focus fix 7.0 #15784
Conversation
…before calling the passed in onItemClick callback or calling setSelectedItem
|
||
// Continue processing the click only after | ||
// performing menu close / control focus(inner working) | ||
onItemClick && onItemClick(ev, item, index); |
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.
The only things changed as part of this PR is moving lines 1593 and 1594 to here (lines 1609 and 1610)
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f3a0214:
|
Perf AnalysisNo significant results to display. All results
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 9c0596c67f5fad10823f6b626926f0444873bc8c (build) |
🎉 Handy links: |
Pull request checklist
$ yarn change
Description of changes
Previous to this change there was a case when a controlled comboBox could move focus as part of either
onItemClick
oronChange
prop callbacks, but then the comboBox would refocus the input afterwards leading to unexpected focus behavior.This PR allows the comboBox to handle its internal focus handling and potential menu closing prior to calling the
onItemClick
andonChange
callbacks. This allows the comboBox to deal with its inner focus handling before communicating outwardly fixing the potential unexpected stealing of focus back to the inputFocus areas to test
Verified that the comboBox functionality didn't change and the comboBox no longer steals focus back if it was moved as part of
onItemClick
oronChange