Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support validate on multiselect #344

Open
Whoaa512 opened this issue Dec 10, 2021 · 0 comments
Open

Support validate on multiselect #344

Whoaa512 opened this issue Dec 10, 2021 · 0 comments

Comments

@Whoaa512
Copy link
Contributor

Whoaa512 commented Dec 10, 2021

Is your feature request related to a problem?

I'm frustrated that I have to add manual validation after my prompt runs for multiselect prompts

Describe the solution you'd like

Support validate option on multiselect and autocompleteMultiselect

Describe alternatives you've considered

Current workaround

async function getThings(choices): Promise<string[]> {
  // prompt to ask for which images to bump
  const answers = await prompts({
    type: 'multiselect',
    name: 'things',
    message: 'Which things do you want to bump?',
    choices,
  });
  if (answers.things.length === 0) {
    return getThings(choices);
  }

  return answers.things;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant