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

ipyvuetify.Select component returns empty {} data when selecting item with value: 0 #325

Open
Chiragasourabh opened this issue Nov 12, 2024 · 1 comment

Comments

@Chiragasourabh
Copy link

Chiragasourabh commented Nov 12, 2024

When using the Select component from ipyvuetify, selecting an item with value: 0 in the list of items results in an empty {}object being sent as data in the on_select callback. This behavior is unexpected, as I would expect the data parameter to contain the selected item information, similar to selections with non-zero values.

Steps to Reproduce:

Define a list of items with at least one item having value: 0, such as:

items = [{'text': 'Value 0', 'value': 0}, {'text': 'Value 1', 'value': 1}, {'text': 'Value 2', 'value': 2}]

Create a Select component with this items list:

import ipyvuetify as v

def on_select(widget, event, data):
    print("data at on_select", data)

select = v.Select(v_model=[], items=items)
select.on_event('change', on_select)

Select the item with value: 0 and observe the output from on_select

data at on_select {}
data at on_select 1
data at on_select 2

@mariobuikhuizen
Copy link
Collaborator

Thanks for reporting this issue!

It should be fixed with ipyvue v1.11.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants