focus the next tab after closing a tab - fixes #6325

This commit is contained in:
Eugene Pankov 2022-04-30 09:58:20 -07:00
parent 3e2f93c226
commit a31cacf4ee
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -144,7 +144,7 @@ export class AppService {
}
removeTab (tab: BaseTabComponent): void {
const newIndex = Math.max(0, this.tabs.indexOf(tab) - 1)
const newIndex = Math.min(this.tabs.length - 2, this.tabs.indexOf(tab))
this.tabs = this.tabs.filter((x) => x !== tab)
if (tab === this._activeTab) {
this.selectTab(this.tabs[newIndex])