Skip to content

Commit

Permalink
fix(ui5-dynamic-page): update header sticky on manual snap (#10431)
Browse files Browse the repository at this point in the history
Prevent header glitch when unsnapping after manual snap and scroll

When the header was manually snapped before scrolling, the sticky area
state wasn't properly updated, causing visual glitches during unsnap.

Fixes: #10430
  • Loading branch information
NakataCode authored Jan 6, 2025
1 parent 2b2b268 commit 1975d56
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/fiori/src/DynamicPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ class DynamicPage extends UI5Element {
const headerHeight = this.dynamicPageHeader.getBoundingClientRect().height;
const lastHeaderSnapped = this._headerSnapped;

if (this._headerSnapped && scrollTop > headerHeight) {
this.showHeaderInStickArea = false;
}

const shouldSnap = !this._headerSnapped && scrollTop > headerHeight + SCROLL_THRESHOLD;
const shouldExpand = this._headerSnapped && (scrollTop < headerHeight - SCROLL_THRESHOLD
|| (!scrollTop && !headerHeight));
Expand Down

0 comments on commit 1975d56

Please sign in to comment.