mirror of
https://github.com/nasa/openmct.git
synced 2025-03-21 03:25:44 +00:00
if editing and styles tab is selected and it exists for the next item, keep it selected
This commit is contained in:
parent
4202de9f98
commit
f4f010ac4f
@ -80,7 +80,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
updateSelection() {
|
||||
const previousSelectedTab = this.selectedTab?.key;
|
||||
const inspectorViews = this.openmct.inspectorViews.get(this.openmct.selection.get());
|
||||
const isEditing = this.openmct.editor.isEditing();
|
||||
|
||||
this.tabs = inspectorViews.map((view) => {
|
||||
return {
|
||||
@ -91,7 +93,13 @@ export default {
|
||||
};
|
||||
});
|
||||
|
||||
this.selectTab(this.visibleTabs[0]);
|
||||
const stylesTabIndex = this.tabs.findIndex((tab) => tab.key === 'stylesInspectorView');
|
||||
|
||||
if (isEditing && previousSelectedTab === 'stylesInspectorView' && stylesTabIndex !== -1) {
|
||||
this.selectTab(this.tabs[stylesTabIndex]);
|
||||
} else {
|
||||
this.selectTab(this.visibleTabs[0]);
|
||||
}
|
||||
},
|
||||
isSelected(tab) {
|
||||
return this.selectedTab?.key === tab.key;
|
||||
|
Loading…
x
Reference in New Issue
Block a user