From 329d66f2853448417e2117fd4cbf0530d0d3c299 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 8 Apr 2015 14:42:45 +0200 Subject: [PATCH] Fix for weird caret position after paste in Firefox --- .../files/js/3rdParty/redactor/plugins/wmonkeypatch.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 6496f486dd..7512287caf 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -1096,6 +1096,13 @@ RedactorPlugins.wmonkeypatch = function() { if ($.browser.msie) { getSelection().getRangeAt(0).collapse(false); } + else if ($.browser.mozilla) { + // bugfix for Firefox setting the caret somewhere in the void + var $range = getSelection().getRangeAt(0); + if ($range.startContainer === this.$editor[0] && $range.endContainer === this.$editor[0]) { + this.wutil.selectionEndOfEditor(); + } + } this.wutil.saveSelection(); }).bind(this), 20); -- 2.20.1