CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.94k stars 236 forks source link

Allow default selection in list #67

Closed duke79 closed 4 years ago

duke79 commented 5 years ago

It's an amazing library!

Can you also add 'default selection' for list? Right now the first element is selected by default on initialization. I have an unending loop through which each choice is selected and an action is performed. It would make sense to keep the selection on the last choice, instead of resetting it back to the first element.

It also seems to be on #TODO list,

default = kwargs.pop('default', 0)  # TODO

Related - #17

paddie commented 5 years ago

I've added a CR to the PR @duke79 - let me know if it makes sense!

@CITGuru how do you feel about this PR? I can see you've not had time to look at it in the last two weeks, but I am very interested in this one as well :)

rroblik commented 4 years ago

+1