Merge pull request #2363 from dpalou/MOBILE-3377

MOBILE-3377 rte: Fix RTE button with selection in Android
main
Juan Leyva 2020-05-07 13:38:16 +02:00 committed by GitHub
commit f19c9d44f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

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