questionary icon indicating copy to clipboard operation
questionary copied to clipboard

Option to use Enter Key to choose from Checkbox

Open amcsparron2793-Water opened this issue 2 years ago • 2 comments

Describe the problem

the use of the spacebar to select options seems counterintuitive to the average user. This is especially true since pressing enter automatically confirms with zero options chosen (I know that this could be prevented with validation). I wonder if a parameter to use enter to select options with a "Finished" option to confirm choices could be added?.

Describe the solution

questionary.checkbox("favorite type of cheese", ["all of them"], enter_confirm = True)

Alternatives considered

No response

amcsparron2793-Water avatar Oct 29 '21 11:10 amcsparron2793-Water

@amcsparron2793-Water this is a good point and I've actually run into this as well. Do you have an idea how to implement that in a backwards compatible way?

tmbo avatar Dec 26 '21 21:12 tmbo

let me work on it and get back to you (@amcsparron2793 [tagging my personal account so I don't forget]). I think some tweaking of /questionary/prompts/checkbox.py around L189 (the key bindings) should do it.

@tmbo it would be great if you could assign my @amcsparron2793 account to this :)

amcsparron2793-Water avatar Dec 28 '21 12:12 amcsparron2793-Water