Skip to content

Commit 745dbc5

Browse files
authored
Merge pull request #3284 from martinRenou/widget_select_keep_none
Select: Do not force a selection if there is currently no selection and the options list changes
2 parents c7bd329 + d488b24 commit 745dbc5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ipywidgets/widgets/widget_selection.py

+6
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ def _propagate_options(self, change):
197197
options = self._options_full
198198
self.set_trait('_options_labels', tuple(i[0] for i in options))
199199
self._options_values = tuple(i[1] for i in options)
200+
201+
if self.index is None:
202+
# Do nothing, we don't want to force a selection if
203+
# the options list changed
204+
return
205+
200206
if self._initializing_traits_ is not True:
201207
if len(options) > 0:
202208
if self.index == 0:

0 commit comments

Comments
 (0)