浏览代码

:art: https://github.com/Vanessa219/vditor/issues/1754

Vanessa 8 月之前
父节点
当前提交
14d7bfae68
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 4 1
      CHANGELOG.md
  2. 2 2
      src/ts/util/fixBrowserBehavior.ts

+ 4 - 1
CHANGELOG.md

@@ -20,8 +20,11 @@
 
 * [open issues](https://github.com/Vanessa219/vditor/issues)
 
-### v3.10.9 / 2025-01
+### v3.11.0 / 2025-03
 
+### v3.10.9 / 2025-02
+
+* [任务列表中的无序列表回车异常](https://github.com/Vanessa219/vditor/issues/1754) `修复缺陷`
 * [添加 `insertEmptyBlock` 方法](https://github.com/Vanessa219/vditor/pull/1745) `开发重构`
 * [撤销后图表会重复](https://github.com/Vanessa219/vditor/issues/1738) `修复缺陷`
 * [设置 defaultLang 之后,指定代码失效](https://github.com/Vanessa219/vditor/issues/1728) `修复缺陷`

+ 2 - 2
src/ts/util/fixBrowserBehavior.ts

@@ -1080,8 +1080,8 @@ export const fixBlockquote = (vditor: IVditor, range: Range, event: KeyboardEven
 
 export const fixTask = (vditor: IVditor, range: Range, event: KeyboardEvent) => {
     const startContainer = range.startContainer;
-    const taskItemElement = hasClosestByClassName(startContainer, "vditor-task");
-    if (taskItemElement) {
+    const taskItemElement = hasClosestByMatchTag(startContainer, "li");
+    if (taskItemElement && taskItemElement.classList.contains("vditor-task")) {
         if (matchHotKey("⇧⌘J", event)) {
             // ctrl + shift: toggle checked
             const inputElement = taskItemElement.firstElementChild as HTMLInputElement;