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
{{ message }}
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
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 the TextEditor model out of the SelectList via selectList.refs.queryEditor, then I intended to do something like:
item=whatever()// the item we want to autocomplete toeditor.setText(item.title)editor.selectLeft(item.title.length-query.length)
But of course using editor.setText() here triggers didChangeQuery() 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() and filter() 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 within atom-select-list somehow.
The text was updated successfully, but these errors were encountered:
Note that using the setQuery() function from #13 , like the example code above, also triggers didChangeQuery() and only supports automatically selecting the entire query. Whereas in typical autocompletion schemes it is only autocompleted text that is selected. For example:
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 freeto 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: