Skip to content

Commit

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

* Prevent anchor value from being `null`
  • Loading branch information
ciampo committed Sep 7, 2022
1 parent a2bad17 commit 99ce463
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-library/src/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ function ButtonEdit( props ) {
setIsEditingURL( false );
richTextRef.current?.focus();
} }
anchorRef={ ref?.current }
// `anchor` should never be `null`
anchor={ ref.current ?? undefined }
focusOnMount={ isEditingURL ? 'firstElement' : false }
__unstableSlotName={ '__unstable-block-tools-after' }
shift
Expand Down

0 comments on commit 99ce463

Please sign in to comment.