You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Keep focus on same item in completion popup when slow completer delivers results. (#5322)
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.
Copy file name to clipboardexpand all lines: src/autocomplete.js
+30-2
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,13 @@ class Autocomplete {
63
63
this.parentNode=null;
64
64
this.setSelectOnHover=false;
65
65
66
+
/**
67
+
* @property {number} stickySelectionDelay - a numerical value that determines after how many ms the popup selection will become 'sticky'.
68
+
* Normally, when new elements are added to an open popup, the selection is reset to the first row of the popup. If sticky, the focus will remain
69
+
* on the currently selected item when new items are added to the popup. Set to a negative value to disable this feature and never set selection to sticky.
0 commit comments