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

inquirer.Separator is not supported #4

Open
BenjaminVanRyseghem opened this issue Aug 30, 2021 · 1 comment
Open

inquirer.Separator is not supported #4

BenjaminVanRyseghem opened this issue Aug 30, 2021 · 1 comment

Comments

@BenjaminVanRyseghem
Copy link

It doesn't look good, and when typing any character, it crashes

Screen Shot 2021-08-30 at 16 08 29

choices: [
	"Pepperoni",
	"Ham",
	"Ground Meat",
	"Bacon",
	new inquirer.Separator(),
	"Mozzarella",
	"Bottle"
],
@wangrongding
Copy link

wangrongding commented Apr 14, 2023

That's how I'm handling it for now.

inquirer
  .prompt([
    {
      type: 'search-list',
      message: 'xxxx',
      name: 'xxxx',
      choices: docList.map((item) => {
        // 👇👇👇👇👇
        if (item.line || item.type) {
          item.name = item.line
          item.value = false
          delete item.line
          delete item.type
        }
        return item
      }),
      validate: (answer) => !!answer,
    },
  ])

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

2 participants