Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/fiori/src/DynamicPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -219,6 +232,10 @@ class DynamicPage extends UI5Element {
return this.querySelector<DynamicPageHeader>("[ui5-dynamic-page-header]");
}

get footerWrapper() {
return this.shadowRoot?.querySelector(".ui5-dynamic-page-footer");
}

get actionsInTitle(): boolean {
return this._headerSnapped || this.showHeaderInStickArea || this.headerPinned;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/fiori/src/themes/DynamicPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}


Expand Down