MOBILE-3320 format-text: Temporary fix to improve height calculation

main
Dani Palou 2021-06-01 14:11:02 +02:00
parent 450a392b42
commit a57297b09a
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}
});
}