From 167cb339ff76e04e7b91b9219ca743e2f94123b2 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 18 Jun 2019 16:18:38 +0200 Subject: [PATCH] MOBILE-3053 rte: Fix height not updated on Android --- src/components/rich-text-editor/rich-text-editor.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/rich-text-editor/rich-text-editor.ts b/src/components/rich-text-editor/rich-text-editor.ts index 59fdabe77..a1254bad9 100644 --- a/src/components/rich-text-editor/rich-text-editor.ts +++ b/src/components/rich-text-editor/rich-text-editor.ts @@ -136,7 +136,11 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy const deferred = this.utils.promiseDefer(); setTimeout(() => { - const contentVisibleHeight = this.domUtils.getContentHeight(this.content) - this.kbHeight; + let contentVisibleHeight = this.domUtils.getContentHeight(this.content); + if (!this.platform.is('android')) { + // In Android we ignore the keyboard height because it is not part of the web view. + contentVisibleHeight -= this.kbHeight; + } if (contentVisibleHeight <= 0) { deferred.resolve(0); @@ -149,7 +153,7 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy let height; if (this.platform.is('android')) { - // Android, ignore keyboard height because web view is resized. + // In Android we ignore the keyboard height because it is not part of the web view. height = this.domUtils.getContentHeight(this.content) - this.getSurroundingHeight(this.element); } else if (this.platform.is('ios') && this.kbHeight > 0) { // Keyboard open in iOS.