PyInquirer icon indicating copy to clipboard operation
PyInquirer copied to clipboard

example/checkbox.py validate is not working

Open g-paras opened this issue 3 years ago • 3 comments

According to the code, user must select at least one topping otherwise it should print 'You must choose at least one topping' then ask again but instead program prints a dictionary with toppings as key and empty list as value, which is wrong.

g-paras avatar May 15 '21 10:05 g-paras

I can reproduce the issue.

flavienbwk avatar Jul 23 '21 15:07 flavienbwk

I can reproduce the issue.

prompt([
    {
        'type': 'checkbox',
        'name': 'invalid_value',
        'message': 'Any value invalid',
        'validate': lambda answer: False,
        'choices': [{'name': 'item 1'}, {'name': 'item 2'}, {'name': 'item 3'}]
    }
])

The example from the documentation doesn't work either.

kyzima-spb avatar Jul 31 '21 13:07 kyzima-spb

I think it's not implemented yet: https://github.com/CITGuru/PyInquirer/blob/master/PyInquirer/prompts/checkbox.py#L121

juandspy avatar Jun 21 '22 11:06 juandspy