From 53f55aeb484e6a700c2ab940fefcfae8032229fc Mon Sep 17 00:00:00 2001 From: Tong Xi Date: Wed, 1 Nov 2023 19:03:14 -0400 Subject: [PATCH] =?UTF-8?q?fixed=20issue=205181=20where=20link=20address?= =?UTF-8?q?=20is=20not=20shown=20if=20comment=20is=20set=20in=E2=80=A6=20(?= =?UTF-8?q?#5188)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/FloatingLinkEditorPlugin/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/lexical-playground/src/plugins/FloatingLinkEditorPlugin/index.tsx b/packages/lexical-playground/src/plugins/FloatingLinkEditorPlugin/index.tsx index b3ec875fb0c..60af7bfd44e 100644 --- a/packages/lexical-playground/src/plugins/FloatingLinkEditorPlugin/index.tsx +++ b/packages/lexical-playground/src/plugins/FloatingLinkEditorPlugin/index.tsx @@ -59,9 +59,10 @@ function FloatingLinkEditor({ const selection = $getSelection(); if ($isRangeSelection(selection)) { const node = getSelectedNode(selection); - const parent = node.getParent(); - if ($isLinkNode(parent)) { - setLinkUrl(parent.getURL()); + const linkParent = $findMatchingParent(node, $isLinkNode); + + if (linkParent) { + setLinkUrl(linkParent.getURL()); } else if ($isLinkNode(node)) { setLinkUrl(node.getURL()); } else {