Skip to content

Commit

Permalink
Merge pull request #2705 from AndreyMarchuk/patch-1
Browse files Browse the repository at this point in the history
Fix: "Cannot resolve a DOM node from Slate node" floating link case
  • Loading branch information
zbeyens authored Oct 17, 2023
2 parents d652688 + a290ecc commit 2de5ea7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fast-eggs-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@udecode/plate-link": patch
---

Fix: "Cannot resolve a DOM node from Slate node" floating link case
4 changes: 3 additions & 1 deletion packages/link/src/transforms/submitFloatingLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export const submitFloatingLink = <V extends Value>(editor: PlateEditor<V>) => {
skipValidation: true,
});

focusEditor(editor, editor.selection!);
setTimeout(() => {
focusEditor(editor, editor.selection!);
}, 0);

return true;
};

0 comments on commit 2de5ea7

Please sign in to comment.