Closed brandonjpierce closed 7 years ago
filter is not applied to the selected value / answer. To reproduce adjust your example.js file prompts to:
filter
example.js
{ type: 'autocomplete', name: 'fruit', suggestOnly: true, message: 'What is your favorite fruit?', source: searchFood, pageSize: 4, filter: answer => answer.slice(0, 2), validate: function(val) { return val ? true : 'Type something!'; }, }, { type: 'autocomplete', name: 'state', message: 'Select a state to travel from', source: searchStates, filter: answer => answer.slice(0, 2), },
Notice the values remain unchained.
Thanks for reporting, is fixed in latest release 0.9.0
https://github.com/mokkabonna/inquirer-autocomplete-prompt/commit/59b29e7e060a8aa6599481a907b6fc582e7d5676
Currently only synchronous filter is implemented
Excellent, thanks so much!
Have now implemented async filter as well. 0.10.0
filter
is not applied to the selected value / answer. To reproduce adjust yourexample.js
file prompts to:Notice the values remain unchained.