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

combobox cannot be updated in event handler #1501

Closed
henrycs opened this issue Jun 15, 2022 · 0 comments · Fixed by #1538
Closed

combobox cannot be updated in event handler #1501

henrycs opened this issue Jun 15, 2022 · 0 comments · Fixed by #1538
Assignees
Labels
bug Bug in code ui Related to UI

Comments

@henrycs
Copy link
Contributor

henrycs commented Jun 15, 2022

Wave SDK Version, OS

h2o-wave-0.22.0, Ubuntu 20.4

Actual behavior

I put a combobox in page, and try to update choices and value in another event handler, no effects, the choices and value are kept in origin state, in same event handle, I set a text widget with a new content, it's OK.
Another testing, I restore wave to 0.21.0, same code, this time the choices are updated successfully (value of combobox not updated)

Expected behavior

Choices and value updated successfully

Steps To Reproduce

My testing code:

@on('btn1')
async def on_test_clicked(q: Q):
    q.page['nav'].items[1].combobox.value = '444'
    q.page['nav'].items[1].combobox.choices = ['444', '555']
    q.page['nav'].items[2].text.content = 'button1 clicked'
    await q.page.save()

@app('/demo')
async def serve(q: Q):
    if not q.client.initialized:
        q.client.initialized = True
        q.page['nav'] = ui.form_card(
            box='1 1 3 3',
            title='Test Page',
            items=[
                ui.button(label='btn1', name="btn1"),
                ui.combobox(
                    name="change_symbol",
                    value="111",
                    choices=['111', '222'],
                    trigger=True,
                    placeholder="please input your code",
                ),
                ui.text(content="mycode"),
            ]
        )
    await handle_on(q)
    await q.page.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code ui Related to UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants