@wholiver_hu/metis 0.80.10 → 0.80.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1538,22 +1538,28 @@ export class InteractiveMode {
1538
1538
  if (this.customFooter?.dispose) {
1539
1539
  this.customFooter.dispose();
1540
1540
  }
1541
- // Remove current footer from UI
1542
- if (this.customFooter) {
1543
- this.ui.removeChild(this.customFooter);
1544
- }
1545
- else {
1546
- this.ui.removeChild(this.footer);
1547
- }
1541
+ // Find the index of the current footer in the bottom container
1542
+ const currentFooter = this.customFooter || this.footer;
1543
+ const index = this.bottomContainer.children.indexOf(currentFooter);
1548
1544
  if (factory) {
1549
1545
  // Create and add custom footer, passing the data provider
1550
1546
  this.customFooter = factory(this.ui, theme, this.footerDataProvider);
1551
- this.ui.addChild(this.customFooter);
1547
+ if (index !== -1) {
1548
+ this.bottomContainer.children[index] = this.customFooter;
1549
+ }
1550
+ else {
1551
+ this.bottomContainer.addChild(this.customFooter);
1552
+ }
1552
1553
  }
1553
1554
  else {
1554
1555
  // Restore built-in footer
1555
1556
  this.customFooter = undefined;
1556
- this.ui.addChild(this.footer);
1557
+ if (index !== -1) {
1558
+ this.bottomContainer.children[index] = this.footer;
1559
+ }
1560
+ else {
1561
+ this.bottomContainer.addChild(this.footer);
1562
+ }
1557
1563
  }
1558
1564
  this.ui.requestRender();
1559
1565
  }