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 stores previously selected values and allows to select them even when the options change #3753

Closed
HariniMadhi opened this issue Apr 6, 2023 · 2 comments
Labels
answered The issue has been answered by a community member.

Comments

@HariniMadhi
Copy link

When the options of the combobox change, and previously some value has been selected, the previously selected value is also seen in the new options, under a line.
But the issue is that, it allows that value to also be selected - but that is not a part of the new options of the combobox.

To reproduce,

import ipywidgets as widgets
from IPython.display import display

options1 = ['1', '2', '3', '4', '5']
options2 = ['11', '12', '13', '14', '15']

combo = widgets.Combobox(options = options1, placeholder = 'Displaying Options1 on click')
display(combo)

Click on any option, and then:

combo.options = options2
combo.placeholder = 'Displaying Options2 on click'

After executing this, the expected behaviour is to display the placeholder, or the first element in options2.

But still the older selected value is displayed - even though its not in options2.
Deleting it and clicking to see the options displays the older selection in the last row, and allows it to be selected

@maartenbreddels
Copy link
Member

Hi,

thank you for your report. Which version of ipywidgets is this, because I think this is fixed in #3682 which is released as 8.0.6.

Regards,

Maarten

@ibdafna ibdafna added the answered The issue has been answered by a community member. label Apr 10, 2023
@HariniMadhi
Copy link
Author

Hi, Thanks. I'm using version 7.6.3
Will update and check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered The issue has been answered by a community member.
Projects
None yet
Development

No branches or pull requests

3 participants