Jochem Stoel
Jochem Stoel

Reputation: 1381

TinyMCE Autocomplete Without Trigger Character, like gmail

I'm looking for a way to implement an autocomplete function of some sorts in TinyMCE that does not require a trigger character or shows a list of matches, but in stead suggests the continuation of a sentence like gmail does when you write an email.

the rest of the sentence is suggested by the application

(the rest of the sentence is suggested by the application)

In stead of the trigger character, the string to match will have to be for example the last few words typed, or the current sentence so far.

I have the backend to provide the actual suggestion based on a partial sentence but I can not find a way to implement this client side anywhere in the documentation. The only post on stackoverflow that looked relevant did not have the answer.

It does not work to simply not provide any trigger character, and it is also not possible to use a space bar / whitespace as the trigger character. Even if you could, it still needs to query the document for the querystring to send to my backend, not just the characters followed by a trigger character.

Should I not be using the autocomplete functionality for this? Is there a better way? How do I go about doing this?

https://fiddle.tiny.cloud/u7haab/12

Upvotes: 1

Views: 308

Answers (0)

Related Questions