From ddd82378aa600d0e2c196453f492008431b067e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 7 Mar 2022 13:12:11 +0100 Subject: [PATCH] MOBILE-3814 collapsible: Change frozen status calculation --- src/core/directives/collapsible-header.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/directives/collapsible-header.ts b/src/core/directives/collapsible-header.ts index dab6b839c..8dab80acb 100644 --- a/src/core/directives/collapsible-header.ts +++ b/src/core/directives/collapsible-header.ts @@ -363,8 +363,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest } const scrollableHeight = contentScroll.scrollHeight - contentScroll.clientHeight; - const collapsedHeight = expandedHeaderHeight - (expandedHeader.clientHeight ?? 0); - const frozen = scrollableHeight + collapsedHeight <= 2 * expandedHeaderHeight; + const frozen = scrollableHeight <= scrollingHeight; const progress = frozen ? 0 : CoreMath.clamp(contentScroll.scrollTop / scrollingHeight, 0, 1); @@ -377,7 +376,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest .entries(progress > .5 ? collapsedFontStyles : expandedFontStyles) .forEach(([property, value]) => floatingTitle.style.setProperty(property, value as string)); - if (progress > 0 || progress < 1) { + if (progress > 0 && progress < 1) { // Finish opening or closing the bar. this.endAnimationTimeout = window.setTimeout(() => this.endAnimation(progress), 500); }