From 7bb2346ec270e1b8e4f3ed982adf340e57631bbc Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 31 Aug 2022 13:15:49 +0300 Subject: [PATCH] Page Content: Fix replace header behaviour --- .../sharedComponents/page-content/page-content.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dashboard/sharedComponents/page-content/page-content.component.ts b/dashboard/sharedComponents/page-content/page-content.component.ts index 36e21a7e..93638770 100644 --- a/dashboard/sharedComponents/page-content/page-content.component.ts +++ b/dashboard/sharedComponents/page-content/page-content.component.ts @@ -127,9 +127,11 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy { if (this.header) { let headerObs = new IntersectionObserver(entries => { entries.forEach(entry => { - this.layoutService.setReplaceHeader(!entry.isIntersecting); + if(entry.boundingClientRect.height > 0) { + this.layoutService.setReplaceHeader(!entry.isIntersecting); + } }) - }, {threshold: 0.5}); + }); this.subscriptions.push(headerObs); headerObs.observe(this.header.nativeElement); }