fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 231 forks source link

Mid sentence autocomplete. #134

Closed mattvv closed 8 years ago

mattvv commented 8 years ago

Hey guys,

Trying to get a simple autocoplete going, and it's working well so far for results at the start of a sentence. For example:

List: [ @matt, @all, @hello ]

If I type "@" then the whole list appears, if I type '@m' then @matt appears. However If I type 'Hello @'. I want to display the whole list, to replace that last @. Like an autocomplete. Is there any way to enable this functionality?

thehuey commented 8 years ago

You're asking for a "Select All Matching" functionality? You'd have to add that as a custom option to the top and have a function to populate all matches.

On Wed, Sep 30, 2015 at 11:41 AM, Matt Van notifications@github.com wrote:

Hey guys,

Trying to get a simple autocoplete going, and it's working well so far for results at the start of a sentence. For example:

List: [ @matt https://github.com/matt, @all https://github.com/all, @hello https://github.com/hello ]

If I type "@" then the whole list appears, if I type '@m https://github.com/m' then @matt https://github.com/matt appears. However If I type 'Hello @'. I want to display the whole list, to replace that last @. Like an autocomplete. Is there any way to enable this functionality?

— Reply to this email directly or view it on GitHub https://github.com/fmoo/react-typeahead/issues/134.

mattvv commented 8 years ago

Basically I want the same @ functionality in this comment box. Whenever i'm in the textbox here and you type @ it populates a typehead, like @thehuey .

Currently with react typeahead it's only doing it if the @ is the first letter in the textarea

fmoo commented 8 years ago

Hey Matt. It sounds like you want something more like how mentions work on Facebook and Twitter.

This typeahead is built as a general solution to support a single value typeahead entry (Typeahead) or a multi-value typeahead entry (Tokenizer). Neither really supports intermixing tokens with text.

You could probably build what you want with pieces of this library, but this isn't functionality we support out of the box today.

mattvv commented 8 years ago

Thanks guys, No worries!