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

input_group action cancelable 表现错误 #614

Closed
kkkbird opened this issue Oct 24, 2023 · 2 comments
Closed

input_group action cancelable 表现错误 #614

kkkbird opened this issue Oct 24, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@kkkbird
Copy link

kkkbird commented Oct 24, 2023

BUG描述
使用input_group的例程,添加cancelable=True

def check_form(data):
    print("call validate check form")

    if len(data['name']) > 6:
        return ('name', 'Name to long!')
    if data['age'] <= 0:
        return ('age', 'Age cannot be negative!')

data = input_group("Basic info", [
    input('Input your name', name='name'),
    input('Repeat your age', name='age', type=NUMBER)
], validate=check_form, cancelable=True)

if data is None:
    put_text("cancelled")
else:
    put_text(data['name'], data['age'])

故意输入错误的name或者age字段,submit使validate返回错误。再点击cancel,此时validate不会被调用,data获得的是上一次的错误的值

环境信息

  • 操作系统及版本: windows11
  • 浏览器及版本: edge
  • Python版本:
  • PyWebIO版本: 1.8.2
@kkkbird kkkbird added the bug Something isn't working label Oct 24, 2023
@kkkbird kkkbird changed the title input_group action cancelable 在validate错误后 input_group action cancelable 表现错误 Oct 24, 2023
@wang0618
Copy link
Member

多谢反馈,尽快会修复这个bug

@wang0618
Copy link
Member

新版本 v1.8.3 中已经修复这个bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants