Skip to content

Commit

Permalink
Explain what capturingClientId is
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Jun 21, 2024
1 parent 285ac09 commit bceca61
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,19 @@ export default function BlockToolbarPopover( {
isToolbarForced.current = false;
} );

// If the block has a parent with __experimentalCaptureToolbars enabled,
// the toolbar should be positioned over the topmost capturing parent.
const clientIdToPositionOver = capturingClientId || clientId;

const popoverProps = useBlockToolbarPopoverProps( {
contentElement: __unstableContentRef?.current,
clientId: capturingClientId || clientId,
clientId: clientIdToPositionOver,
} );

return (
! isTyping && (
<BlockPopover
clientId={ capturingClientId || clientId }
clientId={ clientIdToPositionOver }
bottomClientId={ lastClientId }
className={ clsx( 'block-editor-block-list__block-popover', {
'is-insertion-point-visible': isInsertionPointVisible,
Expand Down

0 comments on commit bceca61

Please sign in to comment.