Skip to content

Commit

Permalink
fix(composition): reinput when cursor in link fornt (#307)
Browse files Browse the repository at this point in the history
* fix(composition):  reinput when cursor in link fornt

* Create young-crabs-wonder.md
  • Loading branch information
cycleccc authored Nov 2, 2024
1 parent c4386de commit 1e70838
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/young-crabs-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wangeditor-next/core": patch
"@wangeditor-next/editor": patch
---

fix(composition): reinput when cursor in link fornt
4 changes: 2 additions & 2 deletions packages/core/src/text-area/event-handlers/composition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function areBothTextNodes(editor, selection) {
const { anchor, focus } = selection

if (
anchor.path.length === 2
&& focus.path.length === 2
[2, 3].includes(anchor.path.length)
&& [2, 3].includes(focus.path.length)
&& (anchor.offset === 0 || focus.offset === 0)
) {
const nowEntry = Editor.node(editor, anchor.path)
Expand Down

0 comments on commit 1e70838

Please sign in to comment.