Open man-trackunit opened 4 months ago
This would make it very difficult to not select anything... Is it perhaps unclear that what you are hovering is not selected? Any suggestions on how we can make it more clear?
Good point with not being able to proceed without making a selection. I guess the first item could be a default none
option but I see how that complicates things (although I'd still like it).
I guess having the greyed out checkmark look more like an actual checkbox would be helpful too. ๐ค
What we can do is add a Footer to the prompt, that has the instructions of something along the lines of "Space to select, Enter to confirm". Would you be interested in contributing the change?
If you'd like to contribute the change, you can also change the indicators for the multiselects. Enquirer's typings unfortunately don't allow for the props as needed so you'll have to cast. The selects would look something like this:
const { value } = await prompt</*...*/>({
type: 'multiselect',
name: 'value ',
message: '...',
choices: [
// ...
],
footer: 'Press <space> to select, <return> to submit.',
indicator(state, choice) {
return choice.enabled ? chalk.green('โ') : chalk.dim('โ');
},
} as any);
Alright, thanks for the update. I'll give it a shot on next non-crunch day ๐
Description
x-prompt multiselect should select the currently hovered option when pressing enter if no selection is made. Maybe optional.
Motivation
9/10 times when I click through a prompt with multiselect, especially if placed next to simple selects, I end up not selecting anything and have to start over when faced with a multiselect.
Suggested Implementation
Select the currently hovered option on enter if no selection is made.