From 3ba7773fd1fe8aa4114b2fa52989c47bd7c40053 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 18 Jun 2016 15:08:22 +0200 Subject: [PATCH] Firefox sometimes loses the caret position --- .../install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 6146decf67..6c89e02d5a 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -1310,6 +1310,9 @@ RedactorPlugins.wmonkeypatch = function() { this.selection.implicitRange = document.createRange(); this.selection.implicitRange.setStart($node, $node.length); this.selection.implicitRange.setEnd($node, $node.length); + + getSelection().removeAllRanges(); + getSelection().addRange(this.selection.implicitRange); } else { this.selection.implicitRange = null; -- 2.20.1