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

fix case of a multiselect dropdown becoming single when no selection #2404

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ Other Changes and Additions
Bug Fixes
---------

- Fixes turning off multiselect mode for a dropdown when no selections are currently made.
Previously this resulted in a traceback, but now applies the default selection for
single-select mode. [#2404]

Cubeviz
^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ def _multiselect_changed(self, event):
self._clear_cache()
if self.is_multiselect:
self.selected = [self.selected]
elif isinstance(self.selected, list):
elif isinstance(self.selected, list) and len(self.selected):
self.selected = self.selected[0]
else:
self._apply_default_selection()
Expand Down