Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example/checkbox.py validate is not working #161

Open
g-paras opened this issue May 15, 2021 · 3 comments · May be fixed by #168
Open

example/checkbox.py validate is not working #161

g-paras opened this issue May 15, 2021 · 3 comments · May be fixed by #168

Comments

@g-paras
Copy link

g-paras commented May 15, 2021

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.

@flavienbwk
Copy link

I can reproduce the issue.

@kyzima-spb
Copy link

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.

@juandspy
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants