mokkabonna / inquirer-autocomplete-prompt

Autocomplete prompt for inquirer
ISC License
354 stars 82 forks source link

Filter value not applied to UI #32

Closed brandonjpierce closed 7 years ago

brandonjpierce commented 7 years ago

Hello, me again :D

So the recent filter update you made works great, thanks again for adding that! In default inquirer prompts, if you supply a filter, that filter value will become the answer in the UI.

I've provided a gif to make it easier to explain what I mean. Notice the default input type prompt's display answer is converted to ab even though abc123 was entered. However in the autocomplete prompt the answer value is not changed even though a filter is supplied. The filter for both prompts is simply: answer.slice(0, 2).

autocomplete-bug

mokkabonna commented 7 years ago

Try lastest release 0.11.0, it should behave like the normal text input in this regard.

mokkabonna commented 7 years ago

I saw your comment on email. The reason for putting it behind the flag is because in suggestOnly mode it behaves like the input prompt. With the flag off it behaves like the list prompt. And the list prompt does not apply the filter for the ui. I will change it if it gets changed in inquirer itself.

But maybe you saw that and deleted the comment?

brandonjpierce commented 7 years ago

@mokkabonna Yeah I misunderstood the default behavior of inquirer, your implementation of filtering the value when in suggestOnly mode is correct!