yury-dymov / react-autocomplete-input

Autocomplete input field for React
https://yury-dymov.github.io/react-autocomplete-input/
MIT License
199 stars 65 forks source link

Autocomplete does not work at the beginning of an input. #5

Closed oolleegg55 closed 7 years ago

oolleegg55 commented 7 years ago

In the docs we have the notice:

Keep in mind that user have to input at least one extra character to make option list available if empty trigger is used.

It is a very inconvenient restriction. How can it be avoided?

yury-dymov commented 7 years ago

Please describe the flow.

Do you want to show all autocomplete options all the time? Doesn't seem like textarea use-case. Or did I miss something?

oolleegg55 commented 7 years ago

I tried it with an input element and set trigger as empty string. I want to use it as autocomplete for each word in an input but now first word isn't served.

Maybe this gif would show: https://myefe.com/wp-content/uploads/sites/2/2017/03/Peek-2017-03-24-09-01.gif

yury-dymov commented 7 years ago

ok, I see. Will have a look in the weekend. PRs are also welcome :)

oolleegg55 commented 7 years ago

Oh, the getMatch function is a little tricky. I'm not sure I could change it properly. :smile: