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

New values in ui.combobox trigger a button submission #2342

Closed
pascal-pfeiffer opened this issue Jun 5, 2024 · 0 comments · Fixed by #2343
Closed

New values in ui.combobox trigger a button submission #2342

pascal-pfeiffer opened this issue Jun 5, 2024 · 0 comments · Fixed by #2343
Labels
bug Bug in code ui Related to UI

Comments

@pascal-pfeiffer
Copy link

Wave SDK Version, OS

h2o-wave 1.2.0

Actual behavior

Minimum code example:

from h2o_wave import Q, app, main, ui


@app("/")
async def serve(q: Q):
    print(q.args)
    q.page['example'] = ui.form_card(box='1 1 2 2', items=[
        ui.combobox(
            name="my_coolest_combobox",
            label="Selection",
            values=["choice1"],
            required=False,
            choices=["choice1", "choice2"],
            trigger=True,
        ),
        ui.button(
            name="i_am_a_button",
            label=(
                "Don't click me"
            ),
            primary=True,
        )
    ])
    await q.page.save()

When adding a new value to the combobox, I am getting:
q.args: __wave_submission_name__:'i_am_a_button'

When selecting an existing value in the combobox, I am getting:
q.args: __wave_submission_name__:'my_coolest_combobox'

Expected behavior

In both cases, I would expect the __wave_submission_name__ to be `'my_coolest_combobox'``

Steps To Reproduce

  1. Use minimum code example above
  2. Add an new value to the combobox and wait for the trigger
  3. Select a value from the combobox and wait for the trigger
  4. Compare q.args prints in the console
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.

2 participants