diff --git a/packages/fiori/src/DynamicPage.ts b/packages/fiori/src/DynamicPage.ts index d838795cc228..8495c15fd1a1 100644 --- a/packages/fiori/src/DynamicPage.ts +++ b/packages/fiori/src/DynamicPage.ts @@ -209,6 +209,19 @@ class DynamicPage extends UI5Element { this.dynamicPageTitle.hasSnappedTitleOnMobile = !!this.hasSnappedTitleOnMobile; this.dynamicPageTitle.removeAttribute("hovered"); } + const titleHeight = this.dynamicPageTitle?.getBoundingClientRect().height || 0; + const headerHeight = this.dynamicPageHeader?.getBoundingClientRect().height || 0; + const footerHeight = this.showFooter ? this.footerWrapper?.getBoundingClientRect().height : 0; + + if (this.scrollContainer) { + this.scrollContainer.style.setProperty("scroll-padding-block-end", `${footerHeight}px`); + + if (this._headerSnapped) { + this.scrollContainer.style.setProperty("scroll-padding-block-start", `${titleHeight}px`); + } else { + this.scrollContainer.style.setProperty("scroll-padding-block-start", `${headerHeight + titleHeight}px`); + } + } } get dynamicPageTitle(): DynamicPageTitle | null { @@ -219,6 +232,10 @@ class DynamicPage extends UI5Element { return this.querySelector("[ui5-dynamic-page-header]"); } + get footerWrapper() { + return this.shadowRoot?.querySelector(".ui5-dynamic-page-footer"); + } + get actionsInTitle(): boolean { return this._headerSnapped || this.showHeaderInStickArea || this.headerPinned; } diff --git a/packages/fiori/src/themes/DynamicPage.css b/packages/fiori/src/themes/DynamicPage.css index a1fb9eeb3f6b..4b2b7a3d4c06 100644 --- a/packages/fiori/src/themes/DynamicPage.css +++ b/packages/fiori/src/themes/DynamicPage.css @@ -44,7 +44,8 @@ /* Footer */ .ui5-dynamic-page-footer { position: sticky; - bottom: 0.5rem; + bottom: 0; + padding: 0 0.5rem 0.5rem 0.5rem; box-sizing: border-box; z-index: 110; opacity: 0; @@ -71,7 +72,6 @@ background-color: var(--_ui5_dynamic_page_header_background_color); box-sizing: content-box; width: auto; - margin: 0 0.5rem 0.5rem 0.5rem; }