diff --git a/.changeset/fast-eggs-burn.md b/.changeset/fast-eggs-burn.md new file mode 100644 index 0000000000..b250211206 --- /dev/null +++ b/.changeset/fast-eggs-burn.md @@ -0,0 +1,5 @@ +--- +"@udecode/plate-link": patch +--- + +Fix: "Cannot resolve a DOM node from Slate node" floating link case diff --git a/packages/link/src/transforms/submitFloatingLink.ts b/packages/link/src/transforms/submitFloatingLink.ts index 86b9afe34d..2321a75d1f 100644 --- a/packages/link/src/transforms/submitFloatingLink.ts +++ b/packages/link/src/transforms/submitFloatingLink.ts @@ -39,7 +39,9 @@ export const submitFloatingLink = (editor: PlateEditor) => { skipValidation: true, }); - focusEditor(editor, editor.selection!); + setTimeout(() => { + focusEditor(editor, editor.selection!); + }, 0); return true; };