Firefox sometimes loses the caret position
authorAlexander Ebert <ebert@woltlab.com>
Sat, 18 Jun 2016 13:08:22 +0000 (15:08 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 18 Jun 2016 13:08:22 +0000 (15:08 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js

index 6146decf67094f9e7691c5a6d879cfe545913df6..6c89e02d5ac0fe892ba52e4655db3c22845b662b 100644 (file)
@@ -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;