2
0
Fork 0

Merge pull request #4055 from NoelDeMartin/MOBILE-4470

MOBILE-4470 core: Fix collapsible header scrolling
main
Pau Ferrer Ocaña 2024-05-22 11:56:07 +02:00 committed by GitHub
commit 24aeb1dfc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 7 deletions

View File

@ -512,9 +512,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest
this.content = content;
const page = this.page;
const scrollingHeight = this.scrollingHeight;
const expandedHeader = this.expandedHeader;
const expandedHeaderHeight = this.expandedHeaderHeight;
const expandedFontStyles = this.expandedFontStyles;
const collapsedFontStyles = this.collapsedFontStyles;
const floatingTitle = this.floatingTitle;
@ -522,9 +520,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest
if (
!page ||
!scrollingHeight ||
!expandedHeader ||
!expandedHeaderHeight ||
!expandedFontStyles ||
!collapsedFontStyles ||
!floatingTitle
@ -543,7 +539,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest
this.content.scrollEvents = true;
this.content.addEventListener('ionScroll', this.contentScrollListener = ({ target }: CustomEvent<ScrollDetail>): void => {
if (target !== this.content || !this.enabled) {
if (target !== this.content || !this.enabled || !this.scrollingHeight) {
return;
}
@ -551,7 +547,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest
const progress = frozen
? 0
: CoreMath.clamp(contentScroll.scrollTop / scrollingHeight, 0, 1);
: CoreMath.clamp(contentScroll.scrollTop / this.scrollingHeight, 0, 1);
this.setCollapsed(progress === 1);
page.style.setProperty('--collapsible-header-progress', `${progress}`);
@ -608,7 +604,6 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest
const scrollingHeight = this.scrollingHeight ?? 0;
const expandedHeaderClientHeight = this.expandedHeader?.clientHeight ?? 0;
const expandedHeaderHeight = this.expandedHeaderHeight ?? 0;
const scrollableHeight = contentScroll.scrollHeight - contentScroll.clientHeight;
let frozen = false;