Skip to content

input_group action cancelable 表现错误 #614

@kkkbird

Description

@kkkbird

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions