Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Add support for as-you-type autocomplete #12

Description

@lexicalunit

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 to
editor.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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions