Browse Source

:art: fix https://github.com/Vanessa219/vditor/issues/1464

Vanessa 2 năm trước cách đây
mục cha
commit
fd9d2d16a6
2 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 1 0
      CHANGELOG.md
  2. 1 0
      src/index.ts

+ 1 - 0
CHANGELOG.md

@@ -13,6 +13,7 @@
 
 ### v3.9.4 / 2023-09
 
+* [insertValue 后光标移动到插入的字符串之后](https://github.com/Vanessa219/vditor/issues/1464) `改进功能`
 * [preview.actions 为空不渲染工具栏](https://github.com/Vanessa219/vditor/issues/1453) `改进功能`
 * [MathJax 支持传入其他配置项](https://github.com/Vanessa219/vditor/issues/1453) `引入特性`
 

+ 1 - 0
src/index.ts

@@ -255,6 +255,7 @@ class Vditor extends VditorMethod {
         const tmpElement = document.createElement("template");
         tmpElement.innerHTML = value;
         range.insertNode(tmpElement.content.cloneNode(true));
+        range.collapse(false);
         if (this.vditor.currentMode === "sv") {
             this.vditor.sv.preventInput = true;
             if (render) {