From f9fbae5a3f6f3c0c8cf3855a0a4c6d8442c89270 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Mon, 5 Sep 2022 15:53:47 +0200 Subject: [PATCH] Navigation block: use new anchor prop for Popover (#43786) * Navigation block: use new `anchor` prop for `Popover` * Use anchor for the Navigation submenu block too * Prevent anchor value from being `null` --- packages/block-library/src/navigation-link/edit.js | 3 ++- packages/block-library/src/navigation-submenu/edit.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/navigation-link/edit.js b/packages/block-library/src/navigation-link/edit.js index c208d83c1a45e..1bddb6cb3800d 100644 --- a/packages/block-library/src/navigation-link/edit.js +++ b/packages/block-library/src/navigation-link/edit.js @@ -844,7 +844,8 @@ export default function NavigationLinkEdit( { setIsLinkOpen( false ) } - anchorRef={ listItemRef.current } + // `anchor` should never be `null` + anchor={ listItemRef.current ?? undefined } shift > setIsLinkOpen( false ) } - anchorRef={ listItemRef.current } + // `anchor` should never be `null` + anchor={ listItemRef.current ?? undefined } shift >