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

[Bug] multiselect doesn't have validate option. #164

Open
renhiyama opened this issue Sep 14, 2023 · 0 comments · May be fixed by #166
Open

[Bug] multiselect doesn't have validate option. #164

renhiyama opened this issue Sep 14, 2023 · 0 comments · May be fixed by #166
Labels
bug Something isn't working

Comments

@renhiyama
Copy link

let value = await clack.multiselect({
    message: g("Choose the features you want to include in your project"),
    options: [
      { label: "React", value: "react" },
      { label: "Preact (compat)", value: "preact" },
      { label: "Twind CSS", value: "twind" },
      { label: "Tailwind CSS", value: "tailwind" },
      { label: "API Server", value: "api" },
      { label: "Serve Static Files", value: "static" },
      { label: "Million.js", value: "million" },
    ],
validate(values){
   if(values.include("million") && !values("react")) return `You need react feature in order to chooes millionjs`;
 }
  });

The validate function isn't ran. This seems to be only there at the text() component. I really need validate option. I currently have to accept the input as-is, and then use a recursive function and conditional logic to do checking.

@renhiyama renhiyama added the bug Something isn't working label Sep 14, 2023
@github-project-automation github-project-automation bot moved this to Needs triage in Triage Board Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Needs triage
Development

Successfully merging a pull request may close this issue.

1 participant