Skip to content

[Feature Request] Pre-Selection for Fuzzy Multiselection Prompts #14

@clark-ja

Description

@clark-ja

Feature Request

Pre-Selection for Fuzzy Multiselection Prompts

It would be very cool to be able to preselect items in a fuzzy multiselection either in place of the default option or as a new option entirely

Suggested Usage

choices = inquirer.fuzzy(
    message="Please select", 
    multiselect=True, 
    choices=get_choices, 
    preselect=get_selections  # or using the pre-existing `default` option instead
)

I was thinking of replacing the default option because it currently seems misleading to me.

Possible Use-case

This can be used to save the state of the prompt for the user between prompts. As an example a pizza delivery service scenario:

  • The user selects toppings for a pizza (via multiselection fuzzy prompt) and then continues to enter his/her address.
  • The user changes his/her mind and wants to modify the toppings again so he/she goes back to the previous prompt.
  • His/Her selections are still visible and can easily be modified without starting all over again.

And thank you for this cool project! :)

EDIT:
I just saw #2. Using an enabled key in the choices would of course be a valid other way of doing it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions