diff --git a/CHANGES.rst b/CHANGES.rst index 700e34caec..c388c4f9c1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -81,6 +81,9 @@ Bug Fixes - Deleting a subset while actively editing it now deselects the subset tool, preventing the appearance of "ghost" subsets. [#2497] +- Fixes a bug in plot options where switching from multi to single-select mode + failed to properly update the selection. [#2505] + Cubeviz ^^^^^^^ diff --git a/jdaviz/configs/default/plugins/plot_options/plot_options.py b/jdaviz/configs/default/plugins/plot_options/plot_options.py index 3fbbbb6369..804751678f 100644 --- a/jdaviz/configs/default/plugins/plot_options/plot_options.py +++ b/jdaviz/configs/default/plugins/plot_options/plot_options.py @@ -571,7 +571,9 @@ def _update_stretch_histogram(self, msg={}): for attr in ('x_min', 'x_max', 'y_min', 'y_max'): vs.add_callback(attr, self._update_stretch_histogram) if isinstance(msg, dict) and msg.get('name') == 'viewer_selected': - viewer_label_old = msg.get('old')[0] if self.multiselect else msg.get('old') + viewer_label_old = msg.get('old') + if isinstance(viewer_label_old, list): + viewer_label_old = viewer_label_old[0] if len(viewer_label_old): vs_old = self.app.get_viewer(viewer_label_old).state for attr in ('x_min', 'x_max', 'y_min', 'y_max'):