From: Alexander Ebert Date: Mon, 23 Jan 2017 16:48:03 +0000 (+0100) Subject: Fixed detection of relative caret position X-Git-Tag: 3.0.2~62^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=95df3329dd14d9f1893a7a86fa6ff7cd9d0db68f;p=GitHub%2FWoltLab%2FWCF.git Fixed detection of relative caret position --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js index 81453a2085..957c223e3e 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js @@ -815,6 +815,11 @@ RedactorPlugins.wutil = function() { return false; } + // check if caret is there are child nodes beyond the current end offset + if ($range.endContainer.childNodes.length > $range.endOffset) { + return false; + } + if ($range.endContainer.nodeType === Element.TEXT_NODE) { // caret is not at the end if ($range.endOffset < $range.endContainer.length) {