From 53e8ebc610cbe752a8fcb391e28007f0c7ed05fb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 16 Dec 2021 19:08:23 +0100 Subject: [PATCH] Selection changes on mobile were recognized as clicks --- .../files/js/3rdParty/redactor2/plugins/WoltLabCaret.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 { -- 2.20.1