widgetti / widgetti/ipyvuetify

Possible to extract selected items in a combox?

Open
#294 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
355
Forks
61
PR merge metrics
No merged PRs in 30d

Description

Been trying to create a Solara component with reacton.ipyvuetify elements. Essentially a Combobox in which I eventually want to be able to select items and dynamically store them in a variable - or store them at the click of a button.

I tried this but got stuck:

import solara as s
import reacton.ipyvuetify as v

items = "item1 item2 item3".split()
chips = s.reactive([items[0]])

@s.component
def Page():

    def on_change(widget, event, data):
        chips.set([???])

    with s.ColumnsResponsive(10, large=[6,6]):
        cb = v.Combobox(
            solo_inverted=True,
            background_color="success",
            solo=True,
            items=items,
            chips=True,
            deletable_chips=True,
            multiple=True,
            autofocus=True,
            prepend_inner_icon="mdi-filter-variant",
            placeholder="Select relevant items",
        )

        btn = v.Btn(children=['CHECK'])
        v.use_event(btn, 'click', on_change)
        s.Markdown(f"Selected: {chips.value}")

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The example using v.Combobox, v.Btn, and v.use_event is the entry point. Trace how the combobox exposes its selected values to the on_change callback, then verify that the selected items can update chips and appear in the rendered Markdown. Done means the example reliably displays the selected items after selection or button activation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.