From: Alexander Ebert Date: Thu, 16 Dec 2021 18:08:23 +0000 (+0100) Subject: Selection changes on mobile were recognized as clicks X-Git-Tag: 5.4.10_dev_1~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=53e8ebc610cbe752a8fcb391e28007f0c7ed05fb;p=GitHub%2FWoltLab%2FWCF.git Selection changes on mobile were recognized as clicks --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js index 4d2f5a6c58..f2bc1347d1 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js @@ -54,8 +54,11 @@ $.Redactor.prototype.WoltLabCaret = function() { }, { passive: true }); editor.addEventListener('touchend', (function (event) { - handleEditorClick(event); - handleEditorMouseUp(event); + const selection = window.getSelection(); + if (selection.rangeCount === 0 || selection.isCollapsed) { + handleEditorClick(event); + handleEditorMouseUp(event); + } }).bind(this)); } else {