From 209cffd19cc0e7d6f744ea24bb584e9f0576f8f3 Mon Sep 17 00:00:00 2001 From: LIlGG <1103069291@qq.com> Date: Wed, 7 Aug 2024 16:09:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20backspace=20on=20empty=20line=20doesn?= =?UTF-8?q?=E2=80=99t=20return=20to=20previous=20list=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/packages/editor/src/extensions/paragraph/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/packages/editor/src/extensions/paragraph/index.ts b/ui/packages/editor/src/extensions/paragraph/index.ts index fe03c34dc5..d304c2bc32 100644 --- a/ui/packages/editor/src/extensions/paragraph/index.ts +++ b/ui/packages/editor/src/extensions/paragraph/index.ts @@ -147,7 +147,7 @@ export function deleteCurrentNodeAndSetSelection( const { tr } = state; if (deleteNodeByPos($from)(tr) && dispatch) { if (beforePos !== 0) { - tr.setSelection(TextSelection.create(tr.doc, beforePos - 1)); + tr.setSelection(TextSelection.near(tr.doc.resolve(beforePos - 1), -1)); } dispatch(tr); return true;