-
-
Notifications
You must be signed in to change notification settings - Fork 302
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
Show and accept number input too for select input type #363
Comments
ucarbehlul
changed the title
Show and accept number for choice input type
Show and accept number input too for select input type
Apr 30, 2022
Seems like a use case for const colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple'];
const doubleColors = colors.reduce((doubles, prefix) => {
colors.forEach((color) => doubles.push(`${prefix}-${color}`));
return doubles;
}, []);
await prompts({
type: 'autocomplete',
name: 'color',
message: 'Pick your favorite color.',
choices: doubleColors.map(color => {return {title: color}}),
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem?
If you are using the select prompt, it sometimes takes lots of key presses to go to the choice you want, especially if you are going through lots of forms.
Describe the solution you'd like
The select prompt type can show number next to each option and if number is typed and entered it can accept that choice.
If tab is pressed after a number, it can jump to the closest option to that and show the list from that position.
That would improve user experience in long lists.
The text was updated successfully, but these errors were encountered: