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

feat: custom instructions in the checkbox type #1139

Merged
merged 1 commit into from Jul 13, 2022
Merged

feat: custom instructions in the checkbox type #1139

merged 1 commit into from Jul 13, 2022

Conversation

zonemeen
Copy link
Collaborator

@zonemeen zonemeen commented Jul 13, 2022

It is now possible to customize the instructions in the checkbox type, for #1138

Instructions support for string or boolean type.

1.When instructions set to false, the help tip disappear:

{
      type: 'checkbox',
      message: 'Select a package manager',
      instructions: false,
      choices: [
          { name: 'npm', value: 'npm' },
          { name: 'yarn', value: 'yarn' },
          { name: 'jspm', value: 'jspm', disabled: true },
      ],
}

2.When instructions set to string, the help tip is customized:

{
      type: 'checkbox',
      message: 'Select a package manager',
      instructions: '空格单选,a键全选,i键取消选择',
      choices: [
          { name: 'npm', value: 'npm' },
          { name: 'yarn', value: 'yarn' },
          { name: 'jspm', value: 'jspm', disabled: true },
      ],
}

3.When instructions are not set or set other values, the help tip is default:

{
      type: 'checkbox',
      message: 'Select a package manager',
      choices: [
          { name: 'npm', value: 'npm' },
          { name: 'yarn', value: 'yarn' },
          { name: 'jspm', value: 'jspm', disabled: true },
      ],
}

@SBoudrias SBoudrias merged commit d70d52f into SBoudrias:master Jul 13, 2022
@SBoudrias
Copy link
Owner

Thanks!! It's been released as @inquirer/checkbox@0.0.22-alpha.0

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

Successfully merging this pull request may close these issues.

None yet

2 participants