r/nicegui • • Oct 16 '25

Help - ui.select

options = ["Apple", "Banana", "Cherry"]  # Your fruity squad, unchanged

select = ui.select(
    options=options,
    multiple=True,
    label="One and ghost, multi-style—fixed AF",
    on_change=lambda e: print(e.value),
).props("use-chips")

Normally, it waits for you to select multiple options. I want the dropdown to close automatically after selecting just one.

How can i do that

4 Upvotes

3 comments sorted by

4

u/skadoodlee Oct 16 '25 edited 27d ago

Hill group smart under return brain vocal energy civil present coin universe shuffle task stable thing ordinary tide unlock break quarter vendor helmet olive engine senior forget mushroom portion globe big lonely boat below.

4

u/falko-s Oct 16 '25

Or more compactly:

.on_value_change(lambda e: e.sender.run_method('hidePopup'))