Skip to content

Commit

Permalink
Navigation block: use new anchor prop for Popover (#43786)
Browse files Browse the repository at this point in the history
* Navigation block: use new `anchor` prop for `Popover`

* Use anchor for the Navigation submenu block too

* Prevent anchor value from being `null`
  • Loading branch information
ciampo committed Sep 14, 2022
1 parent 044dd4a commit f9fbae5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,8 @@ export default function NavigationLinkEdit( {
<Popover
position="bottom center"
onClose={ () => setIsLinkOpen( false ) }
anchorRef={ listItemRef.current }
// `anchor` should never be `null`
anchor={ listItemRef.current ?? undefined }
shift
>
<LinkControl
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/navigation-submenu/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,8 @@ export default function NavigationSubmenuEdit( {
<Popover
position="bottom center"
onClose={ () => setIsLinkOpen( false ) }
anchorRef={ listItemRef.current }
// `anchor` should never be `null`
anchor={ listItemRef.current ?? undefined }
shift
>
<LinkControl
Expand Down

0 comments on commit f9fbae5

Please sign in to comment.