diff --git a/Frontend/src/components/xml/XmlTabbedInputComponent.vue b/Frontend/src/components/xml/XmlTabbedInputComponent.vue index 7da2527..fcaea5a 100644 --- a/Frontend/src/components/xml/XmlTabbedInputComponent.vue +++ b/Frontend/src/components/xml/XmlTabbedInputComponent.vue @@ -94,16 +94,20 @@ function removeTab(id : number) { return let indexToRemove = findIndexWithID(id); + + switchToExistingTab(indexToRemove) + + tabs.value.splice(indexToRemove, 1); + +} + +function switchToExistingTab(indexToRemove: number) { let activeIndex = findIndexWithID(activeTabId.value); if (indexToRemove == activeIndex && activeIndex == 0) changeActiveTab(tabs.value.at(1)!.id) else if (indexToRemove == activeIndex) changeActiveTab(tabs.value.at(0)!.id) - - - tabs.value.splice(indexToRemove, 1); - } function findIndexWithID(id : number) : number {