From b69e2ac8b7f892e119001954508aeedfc8145ff1 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 9 Mar 2022 09:53:12 +0100 Subject: [PATCH] MOBILE-3833 core: Add collapsible header listeners --- src/core/directives/collapsible-header.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/directives/collapsible-header.ts b/src/core/directives/collapsible-header.ts index 0c74b1a39..3b26e56a1 100644 --- a/src/core/directives/collapsible-header.ts +++ b/src/core/directives/collapsible-header.ts @@ -190,6 +190,9 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest }; this.subscriptions.push(outlet.activateEvents.subscribe(onOutletUpdated)); + this.subscriptions.push(outlet.activateEvents.subscribe(onOutletUpdated)); + + onOutletUpdated(); onOutletUpdated(); @@ -311,6 +314,10 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest * @param content Content element. */ protected updateContent(content?: HTMLIonContentElement | null): void { + if (content === (this.content ?? null)) { + return; + } + if (this.content) { if (this.contentScrollListener) { this.content.removeEventListener('ionScroll', this.contentScrollListener); @@ -321,6 +328,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest this.content.removeEventListener('ionScrollEnd', this.endContentScrollListener); delete this.endContentScrollListener; } + delete this.content; }