Open martenjacobs opened 5 years ago
Hmmnnn the error is coming from the choices given. Thats a bad format of choices. Try and removing the default key, it still outputs the same error. And the default must be the index of the value in the given choices.
you can not use dictionaries as choices when the type is rawlist. The error doesn't happen if you actually use a simple list. However, the default configuration still doesn't make any difference. See code bellow.
answer = prompt([{
'type': 'rawlist',
'name': "test-question",
'message': "Select item",
'default': 2,
'choices': ["Item 1", "Item 2", "Item 3", "Item 4"]
}])
print(answer)
In all my tests the default option only works with questions of {type: 'confirm'}
default do not work in list
and rawlist
present in PyInquirer==1.0.3
Using the
default
-key causes an exception when used on a rawlistConsider the following code:
Expected result:
Item 3
is initially selected in the promptActual result:
Environment:
OS: macOS 10.14 Mojave