From a9949e2b1f3c672357a11945a06cd111d5bded3b Mon Sep 17 00:00:00 2001 From: JiHong88 <0125ses@hanmail.net> Date: Tue, 28 Mar 2023 18:35:12 +0900 Subject: [PATCH] hotfix: #1197 selection bug --- src/lib/core.js | 2 +- test/dev/suneditor_build_test.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/core.js b/src/lib/core.js index 8acbdb61a..f5d57de6e 100755 --- a/src/lib/core.js +++ b/src/lib/core.js @@ -1150,7 +1150,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re */ getSelection: function () { const selection = this._shadowRoot && this._shadowRoot.getSelection ? this._shadowRoot.getSelection() : this._ww.getSelection(); - if (!context.element.wysiwyg.contains(selection.focusNode)) { + if (!this._variable._range && !context.element.wysiwyg.contains(selection.focusNode)) { selection.removeAllRanges(); selection.addRange(this._createDefaultRange()); } diff --git a/test/dev/suneditor_build_test.html b/test/dev/suneditor_build_test.html index eec60e309..152624b85 100644 --- a/test/dev/suneditor_build_test.html +++ b/test/dev/suneditor_build_test.html @@ -336,6 +336,8 @@

The Suneditor is based on pure JavaScript, with no dependencies.



+ + afdsafdsja dasi fjdsaio j47vn w8994y r8943pvby49p y9p