From 509222e2d2dd4def4b61bd2bae537ea16e75a0d0 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Fri, 31 May 2019 12:47:49 +0200 Subject: [PATCH] MOBILE-3039 rte: Fix height calculation in Android --- src/components/rich-text-editor/rich-text-editor.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/rich-text-editor/rich-text-editor.ts b/src/components/rich-text-editor/rich-text-editor.ts index 5d2da5941..59fdabe77 100644 --- a/src/components/rich-text-editor/rich-text-editor.ts +++ b/src/components/rich-text-editor/rich-text-editor.ts @@ -148,7 +148,10 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy // Editor is ready, adjust Height if needed. let height; - if (this.platform.is('ios') && this.kbHeight > 0) { + if (this.platform.is('android')) { + // Android, ignore keyboard height because web view is resized. + height = this.domUtils.getContentHeight(this.content) - this.getSurroundingHeight(this.element); + } else if (this.platform.is('ios') && this.kbHeight > 0) { // Keyboard open in iOS. // In this case, the header disappears or is scrollable, so we need to adjust the calculations. height = window.innerHeight - this.getSurroundingHeight(this.element);