浏览代码

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

Vanessa 2 年之前
父节点
当前提交
fd9d2d16a6
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 0
      src/index.ts

+ 1 - 0
CHANGELOG.md

@@ -13,6 +13,7 @@
 
 
 ### v3.9.4 / 2023-09
 ### v3.9.4 / 2023-09
 
 
+* [insertValue 后光标移动到插入的字符串之后](https://github.com/Vanessa219/vditor/issues/1464) `改进功能`
 * [preview.actions 为空不渲染工具栏](https://github.com/Vanessa219/vditor/issues/1453) `改进功能`
 * [preview.actions 为空不渲染工具栏](https://github.com/Vanessa219/vditor/issues/1453) `改进功能`
 * [MathJax 支持传入其他配置项](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");
         const tmpElement = document.createElement("template");
         tmpElement.innerHTML = value;
         tmpElement.innerHTML = value;
         range.insertNode(tmpElement.content.cloneNode(true));
         range.insertNode(tmpElement.content.cloneNode(true));
+        range.collapse(false);
         if (this.vditor.currentMode === "sv") {
         if (this.vditor.currentMode === "sv") {
             this.vditor.sv.preventInput = true;
             this.vditor.sv.preventInput = true;
             if (render) {
             if (render) {