From 50f63d273478e7993e4f1941b9ace496e44309b4 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 5 May 2020 11:37:12 +0200 Subject: [PATCH] MOBILE-3377 rte: Fix RTE button with selection in Android --- .../editor/components/rich-text-editor/rich-text-editor.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/editor/components/rich-text-editor/rich-text-editor.ts b/src/core/editor/components/rich-text-editor/rich-text-editor.ts index a1b19754b..6d51f3515 100644 --- a/src/core/editor/components/rich-text-editor/rich-text-editor.ts +++ b/src/core/editor/components/rich-text-editor/rich-text-editor.ts @@ -15,6 +15,7 @@ import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, AfterContentInit, OnDestroy, Optional } from '@angular/core'; import { TextInput, Content, Platform, Slides } from 'ionic-angular'; +import { CoreApp } from '@providers/app'; import { CoreSitesProvider } from '@providers/sites'; import { CoreFilepoolProvider } from '@providers/filepool'; import { CoreDomUtilsProvider } from '@providers/utils/dom'; @@ -652,8 +653,8 @@ export class CoreEditorRichTextEditorComponent implements AfterContentInit, OnDe */ mouseDownAction(event: Event): void { const selection = window.getSelection().toString(); - // When RTE is focused with a range selection the stopBubble will not fire click. - if (!this.rteEnabled || document.activeElement != this.editorElement || selection == '') { + // When RTE is focused with a whole paragraph in desktop the stopBubble will not fire click. + if (CoreApp.instance.isMobile() || !this.rteEnabled || document.activeElement != this.editorElement || selection == '') { this.stopBubble(event); } }