-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
feat: Keep focus on same item in completion popup when slow completer delivers results. #5322
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5322 +/- ##
==========================================
+ Coverage 87.38% 87.39% +0.01%
==========================================
Files 574 574
Lines 45534 45594 +60
Branches 6935 6938 +3
==========================================
+ Hits 39788 39848 +60
Misses 5746 5746
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
@@ -62,6 +62,7 @@ class Autocomplete { | |||
this.keyboardHandler.bindKeys(this.commands); | |||
this.parentNode = null; | |||
this.setSelectOnHover = false; | |||
this.stickySelectionDelay = 500; |
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.
Can we add JSDoc comment somehow. for this option, since it's a bit hard to understand from just the name without prior context, but it's a pretty cool functionality.
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.
added a (hopefully) descriptive comment about this feature
Issue #, if available: NA
Description of changes: Currently, when there are new async completion results delivered by a completer, the active row of the popup is set back to 0. This is jarring when there are completers which are sufficiently slow that the user has already started to interact with the other, faster, completion results.
This adds a timer such that when completions are delivered a configurable number of milliseconds after opening the popup, the item in focus remains in focus after the new results are added to the popup.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.