diff --git a/.changeset/young-crabs-wonder.md b/.changeset/young-crabs-wonder.md new file mode 100644 index 000000000..9f4472f1b --- /dev/null +++ b/.changeset/young-crabs-wonder.md @@ -0,0 +1,6 @@ +--- +"@wangeditor-next/core": patch +"@wangeditor-next/editor": patch +--- + +fix(composition): reinput when cursor in link fornt diff --git a/packages/core/src/text-area/event-handlers/composition.ts b/packages/core/src/text-area/event-handlers/composition.ts index 4216d9b82..2c6017f5b 100644 --- a/packages/core/src/text-area/event-handlers/composition.ts +++ b/packages/core/src/text-area/event-handlers/composition.ts @@ -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)