mokkabonna / inquirer-autocomplete-prompt

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

Improve default value support #124

Closed kapalex closed 3 years ago

kapalex commented 3 years ago

This improves the default value behavior to be more intuitive.

This should help with #121 but doesn't necessarily solve it.

chief-nerd commented 3 years ago

Can we get this on master please?

chief-nerd commented 3 years ago

@kapalex can you merge this PR? Pipeline passes and It would be great to get this in main or even in a release :)

chief-nerd commented 3 years ago

Sorry also want to ping @mokkabonna to merge this PR.

mokkabonna commented 3 years ago

Thanks for contributing!

I don't think we should do initial search with default value.

As for default select behaviour, I have now aligned even more with default option behaviour for the standard input and list prompts. See master branch.

If in input prompt mode: (suggestOnly=true)

Pressing enter from the start with no text entered will select the default value.

For list prompt mode: (suggestOnly=false)

It only selects the value if a item in the list displayed matches the value of the default option. Pressing enter always selects the highlighted item, be it default or not.


Both of these behaviours should align with the default prompt behaviour for these two types.

See if the new behaviour is resolving your issues.