webscopeio / react-textarea-autocomplete

📝 React component implements configurable GitHub's like textarea autocomplete.
MIT License
451 stars 80 forks source link

Allow immediate autocomplete with no trigger character #180

Open eclecto opened 4 years ago

eclecto commented 4 years ago

My use case is that I want to use inline trigger-based autocompletion elsewhere in my application, but I have a username field where I would like autocomplete to start immediately on any input, without need of a trigger character and without needing a separate plugin. Maybe a new prop that can accept a single settingType object and can be used in place of the trigger prop?

jukben commented 4 years ago

Hey, thanks for the idea! However I'm not sure if we want to support this usecase. RTA supports only textareas anyway. I'll think about it, maybe we can come up with some solution. Anyway, we need to keep the complexity low.

eclecto commented 4 years ago

I was able to use a standard input field instead of a textarea by passing in textAreaComponent='input'

Sarthak-Agrawal commented 4 years ago

Is it possible to trigger autocomplete with an empty string? I tried it here: codesandbox I tried setting the trigger as "" and null but to no avail. Usecase: Render auto-suggestions on each word.

SebastienAuvray commented 3 years ago

Hi! I'm also interested in Sartahk's comment to trigger suggestions on ANY character. I could generate a trigger object with any character, but it looks ugly ;-) I tried passing a Proxy whose get method returns my filtered options, but I didn't get called. Could trigger accept an object with a generic get in which I could return my filtered options for any character typed ?