From a57297b09a180877d7ea1c49823e6673a16347db Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 1 Jun 2021 14:11:02 +0200 Subject: [PATCH] MOBILE-3320 format-text: Temporary fix to improve height calculation --- src/core/directives/format-text.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/directives/format-text.ts b/src/core/directives/format-text.ts index 5709b6b16..f67985298 100644 --- a/src/core/directives/format-text.ts +++ b/src/core/directives/format-text.ts @@ -377,6 +377,7 @@ export class CoreFormatTextDirective implements OnChanges { // Calculate the height now. this.calculateHeight(); + setTimeout(() => this.calculateHeight(), 200); // Try again, sometimes the first calculation is wrong. // Add magnifying glasses to images. this.addMagnifyingGlasses(); @@ -388,6 +389,7 @@ export class CoreFormatTextDirective implements OnChanges { if (data.loaded && CoreDomUtils.closest(this.element.parentElement, '#' + data.uniqueId)) { // The format-text is inside the loading, re-calculate the height. this.calculateHeight(); + setTimeout(() => this.calculateHeight(), 200); } }); }