-
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(Search): pressing up/down arrow in the search input causes error #1600
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1600 +/- ##
==========================================
+ Coverage 99.74% 99.74% +<.01%
==========================================
Files 141 141
Lines 2396 2397 +1
==========================================
+ Hits 2390 2391 +1
Misses 6 6
Continue to review full report at Codecov.
|
Wouldn't it be safer to let the event listeners as usual (after all, the "no result" is still an open popup) but fix the listener functions to not throw an error if the results are empty? Is there a risk of keyboard events bubbling up if they aren't caught when there are no results? |
The Dropdown is almost a copy of this component. Ideally, it would share base logic and features, however, that work was begun but not completed. It may also be worth looking at how the Dropdown solved this issue. It has the same methods but over time has had a lot more attention and therefore fixes. |
Oops, I should have examined scrollSelectedItemIntoView closer instead of making all those other changes, sorry! |
On the surface, this sounds right. There may is likely also a test we can copy over as well that ensures pressing arrow keys when there are no results actually works. |
Going to merge this for now since it is such a minor fix resolves a known bug. |
Released in |
Attempts to fix the issue raised in #1592 by adjusting how event listeners are added/removed based on search results.