diff --git a/erdblick_app/app/feature.panel.component.ts b/erdblick_app/app/feature.panel.component.ts index 50349258..b07cd8c9 100644 --- a/erdblick_app/app/feature.panel.component.ts +++ b/erdblick_app/app/feature.panel.component.ts @@ -206,7 +206,11 @@ export class FeaturePanelComponent implements OnInit { }); this.inspectionService.inspectionPanelChanged.subscribe(() => { - this.table.scroller!.calculateOptions(); + // We have to force recalculate the tables number of visible items + setTimeout(() => { + if (this.table.scroller) + this.table.scroller.calculateOptions(); + }, 0); }) } diff --git a/erdblick_app/app/inspection.panel.component.ts b/erdblick_app/app/inspection.panel.component.ts index d227ce0a..334055fd 100644 --- a/erdblick_app/app/inspection.panel.component.ts +++ b/erdblick_app/app/inspection.panel.component.ts @@ -136,7 +136,7 @@ export class InspectionPanelComponent implements OnInit if (index < 0) index = this.tabs.length - 1; this.inspectionService.inspectionPanelChanged.emit(); - this.activeIndex = index + this.activeIndex = Math.max(0, index) } onGoBack(event: any) { @@ -145,7 +145,7 @@ export class InspectionPanelComponent implements OnInit const onClose = this.tabs[this.activeIndex]['onClose']; if (onClose) onClose(); - this.activeIndex = this.activeIndex - 1; + this.setTab(this.activeIndex - 1); if (this.tabs.length > 1) this.tabs.pop(); }