survey icon indicating copy to clipboard operation
survey copied to clipboard

Skip a select question

Open palash25 opened this issue 6 years ago • 11 comments

When I am using a question with select options, is there a way to skip the question by not selecting any options? We can do this in case of multi-select since we use spacebar to select the options and return key to skip but I couldn't find a way to skip the question in case of select.

Is there a way or workaround for this? cc @AlecAivazis

palash25 avatar Dec 18 '18 16:12 palash25

Hi @AlecAivazis I know you must be busy but I have an urgent PR that is stuck because of this. It would be a great help if you could answer this.

palash25 avatar Dec 24 '18 13:12 palash25

Hey @palash25 - sorry for lagging on responding.

I think for the moment I would recommend 1 of 2 things: Either ask the user with a confirm if they want to choose one of whatever your prompt is selecting, or add an option in the select which you can interpret as no response.

It might make sense to add an Optional field to each Question which allows for esc to cancel them. If you wanted to open a PR I'd love to review it. It'd give me a good starting point to think through the overall user experience. However, since you are currently blocked by this you might want to consider these 2 less than ideal shortcuts.

AlecAivazis avatar Dec 24 '18 16:12 AlecAivazis

Question which allows for esc to cancel them. If you wanted to open a PR I'd love to review it.

swamped with work right now but that is a good idea, if I get some time in the coming days I will take a crack at this.

palash25 avatar Dec 24 '18 16:12 palash25

The ESC key is currently already used to exit the vim-mode. So if we add this feature, we need to use another key. If we could decide for another key, I would also offer to see whether I can create a PR.

MarkusFreitag avatar Jan 16 '19 22:01 MarkusFreitag

The more I think about this issue, the more I'm on the side of removing the vim-like interaction so that we can have escape skip optional questions. That seems like a very intuitive interaction. Maybe we have to move the toggle to another key? I'm not sure anything else makes sense for vim...

I also wonder if this would mean we could remove survey.Required from the list of provided Validators in favor of a new Required field. I'm pretty sure that's required anyway so that we can interpret esc as skip when the question is optional.

AlecAivazis avatar Jun 03 '19 20:06 AlecAivazis

My current feeling is that it does not make sense to have a "skippable" select prompt as described. I would rather see an explicit "no answer" option in the prompt. So instead of something like this:

? Choose a color:  [Use arrows to move, space to select, type to filter, ESC to skip]
> red
  blue
  green

I would recommend a no-op answer, like "none":

? Choose a color:  [Use arrows to move, space to select, type to filter]
> none
  red
  blue
  green

If you want to make it easy on the user to "skip" the prompt, you can set Default to none and then the user just has to hit enter to bypass the prompt.

coryb avatar Jun 05 '19 05:06 coryb

Alright then let's leave this out of v2 for now and we can wait for someone else to ask for it before we go too far exploring options and compromises

AlecAivazis avatar Jun 05 '19 18:06 AlecAivazis

I'm looking for this very feature, are there any plans for implementing it in the near future?

harveyxia avatar Apr 07 '20 13:04 harveyxia

Why not add option none (if skip is specified) and color the option (with red or yellow)?

infalmo avatar Oct 05 '20 16:10 infalmo

I think having a "none" option is an easy workaround that doesn't require extra support from the library. The right move is to have escape skip the option but we dont have a good opportunity to add it yet

AlecAivazis avatar Oct 05 '20 17:10 AlecAivazis

Hello guys, great work. Any update on "Esc" to skip a question?

ihawke-wm avatar Aug 24 '21 02:08 ihawke-wm