Default is ignored on lists
See original GitHub issueIt seems that the default
-key is ignored on list-type questions
Consider the following code:
from PyInquirer import prompt, print_json
answer = prompt({
'type': 'list',
'name': "test-question",
'message': "Select item",
'default': 2,
'choices': [
{ "name" : "Item 1",
"value" : "item1" },
{ "name" : "Item 2",
"value" : "item2" },
{ "name" : "Item 3",
"value" : "item3" },
{ "name" : "Item 4",
"value" : "item4" },
]
})
print_json(answer)
Expected result:
Item 3
is initially selected in the prompt
Actual result:
Item 1
is initially selected in the prompt
Environment:
OS: macOS 10.14 Mojave
$ python3 --version
Python 3.6.1
$ python3 -m pip show PyInquirer
Name: PyInquirer
Version: 1.0.2
Summary: A Python module for collection of common interactive command line user interfaces, based on Inquirer.js
Home-page: https://github.com/CITGuru/PyInquirer/
Author: Oyetoke Toby
Author-email: oyetoketoby80@gmail.com
License: MIT
Location: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requires: prompt-toolkit, Pygments, regex
Required-by:
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Where is the SVN default list of ignored files? - Stack Overflow
You can find the default global file ignore list in the auto-generated user specific config file, in a commented-out line (key global-ignores in...
Read more >Types And Syntax Of Ignore Lists (Stow) - GNU.org
If neither the package-local or global ignore list exist, Stow will use its own built-in default ignore list, which serves as a useful...
Read more >Editing the Default Value for Ignored Fields During List Import
Hi, When I import a list from a csv. file, in the preview Marketo automatically assigns any empty columns to 'Phone Number' as...
Read more >ignoring an empty list when using with_flattened
If the list is undefined, I get an error, and if I use something like host_users_ro|default(omit), I get an error on 'name' not...
Read more >List of file types that are ignored by default | Insync Help Center
There are some file types that are ignored by default even if it's not in your Ignore Rules. Read more about that here....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe this issue should be reopened, it’s still present in version 1.0.3 on PyPI and on master.
From documentation it appears you should be able to define the initially selected list item. Either the documentation should be clarified or this feature should be implemented.