From 26b6b7bb02bd38f5f77da7b797db394112280af8 Mon Sep 17 00:00:00 2001 From: ShaneK Date: Thu, 8 Jan 2026 06:59:16 -0800 Subject: [PATCH] fix(content): exclude nested content from safe-area handling --- core/src/components/content/content.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/components/content/content.tsx b/core/src/components/content/content.tsx index dbe2a3b0dd..87e2c5938e 100644 --- a/core/src/components/content/content.tsx +++ b/core/src/components/content/content.tsx @@ -143,7 +143,10 @@ export class Content implements ComponentInterface { } connectedCallback() { - this.isMainContent = this.el.closest('ion-menu, ion-popover, ion-modal') === null; + // Content is "main" if not inside menu/popover/modal and not nested in another ion-content + this.isMainContent = + this.el.closest('ion-menu, ion-popover, ion-modal') === null && + this.el.parentElement?.closest('ion-content') === null; // Detect sibling header/footer for safe-area handling this.detectSiblingElements(); @@ -178,7 +181,12 @@ export class Content implements ComponentInterface { * bubbles, we can catch any instances of child tab bars loading by listening * on IonTabs. */ - this.tabsLoadCallback = () => this.resize(); + this.tabsLoadCallback = () => { + this.resize(); + // Re-detect footer when tab bar loads (it may not exist during initial detection) + this.updateSiblingDetection(); + forceUpdate(this); + }; closestTabs.addEventListener('ionTabBarLoaded', this.tabsLoadCallback); } }