This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Add support for as-you-type autocomplete #12
Labels
Comments
Note that using the |
lexicalunit
added a commit
to lexicalunit/atom-select-list
that referenced
this issue
May 6, 2018
If and only if this option is set to false, the didChangeQuery() callback will NOT trigger after updating the query. This is useful for things like autocompletion or when you'd want to update the query text while bypassing code that recomputes and filters the list items. This is the only change I needed to make to `SelectListView` to fully implement autocompletion (see atom#12) on top of `atom-select-list`.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As it's currently implemented, there's no evident event hook that could be used to support an autocomplete feature. Initially I tried to use
didChangeQuery()
. I got theTextEditor
model out of theSelectList
viaselectList.refs.queryEditor
, then I intended to do something like:But of course using
editor.setText()
here triggersdidChangeQuery()
and causes an infinite loop. More than that though, it also triggers a filter process for the autocompleted item's text :(I tried to work around it by using some state to make the next
didChangeQuery()
andfilter()
calls into no-ops after doing an autocompletion but it was really janky and slow and I just couldn't get it to work right. This seems like it would be better implemented withinatom-select-list
somehow.The text was updated successfully, but these errors were encountered: