Grofit
Grofit

Reputation: 18465

What libraries are available for contextual auto completion in javascript?

I currently use #Slack and I find its auto complete functionality very refreshing, as I am able to type in # and it will return a list of available commands, as well as me typing @ and it will return a list of available users for me to notify.

So I was wondering what auto complete libraries there are out there that allow contextual auto completion rather than it just being the first letters entered. Here is an example of what I mean:

Example of contextual autocomplete

I know that there is jquery ui autocomplete, but could not find much resource on how to get it to act contextual rather than just on first entry and a search for contextual autocomplete does not bring back much results. I know stackoverflow does something similar for its tags so it may just be the correct terminology for this behaviour that I need to constrain my search, but if anyone can point me in the direction of some way to achieve this functionality without hand rolling it, I would be very happy :)

Upvotes: 4

Views: 1742

Answers (2)

Nicolas Zozol
Nicolas Zozol

Reputation: 7048

Complete.ly is a more complete solution : http://complete-ly.appspot.com/ You can define what will be acceptable knowing different context.

Upvotes: 0

Grofit
Grofit

Reputation: 18465

So far this seems to be the closest thing I can find: https://github.com/podio/jquery-mentions-input

And also it appears that autosuggest is also a thing, so that may be more inline with what I am after, I will not accept this answer in the hope that someone else can point me at a library or even tell me what library #Slack uses to achieve its functionality.

As I already have 3 people wanting to close the question I will assume this will crash and burn in about 5 minutes so incase anyone else is a bit confused as to what you should be looking for here was the only other useful SO article I found relating to this topic.

Facebook style JQuery autocomplete plugin

== UPDATE ==

In the end I finally found: https://github.com/yuku-t/jquery-textcomplete which fits my scenario perfectly and seems maintained, so this would be the one I would opt for.

Upvotes: 3

Related Questions