-
Notifications
You must be signed in to change notification settings - Fork 4k
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(Dropdown): update text when item selected with keyboard #2162
fix(Dropdown): update text when item selected with keyboard #2162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2162 +/- ##
==========================================
+ Coverage 99.73% 99.76% +0.03%
==========================================
Files 151 151
Lines 2611 2600 -11
==========================================
- Hits 2604 2594 -10
+ Misses 7 6 -1
Continue to review full report at Codecov.
|
Our behaviour should match to SUI: |
In fact, problem comes from condition with As I see the following change will not break any test: -if (isAdditionItem || optionSize === 1) this.clearSearchQuery()
+this.clearSearchQuery() @levithomason can you clarify? |
Always clearing seems like the correct solution to me. @ayastreb are there any issues with this feature if we always clear the search query? |
7119225
to
e3529a9
Compare
@levithomason seems to be no issues, all tests are green and it works as expected. |
Thanks guys! |
Released in |
Hi @ayastreb and @levithomason, I'm curious as to why this is only the expected behavior if the item is selected with a keyboard. It currently seems that if there are multiple options and one is clicked with the mouse, the searchQuery is not cleared. This can be handled by locally managing the |
Agreed. It should be consistent. This was an oversight. A new issue and PR would be much appreciated. |
Fixes #2161
the text on dropdown wasn't updated when item is selected with keyboard after search because
searchQuery
wasn't cleared if there are multiple search results (it is cleared if there's only one search result). And ifsearchQuery
is not cleared, we do not update text in renderText