Skip to content

Commit

Permalink
Merge pull request #3284 from martinRenou/widget_select_keep_none
Browse files Browse the repository at this point in the history
Select: Do not force a selection if there is currently no selection and the options list changes
  • Loading branch information
jtpio authored Sep 21, 2021
2 parents c7bd329 + d488b24 commit 745dbc5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ipywidgets/widgets/widget_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ def _propagate_options(self, change):
options = self._options_full
self.set_trait('_options_labels', tuple(i[0] for i in options))
self._options_values = tuple(i[1] for i in options)

if self.index is None:
# Do nothing, we don't want to force a selection if
# the options list changed
return

if self._initializing_traits_ is not True:
if len(options) > 0:
if self.index == 0:
Expand Down

0 comments on commit 745dbc5

Please sign in to comment.