Skip to content

Commit

Permalink
Move inline rich popover into header if top toolbar slot is available
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj committed Nov 2, 2023
1 parent 3a3420f commit 20ce22b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/block-editor/src/components/block-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,20 @@ export default function BlockTools( {
) }

{ /* Used for the inline rich text toolbar. */ }
<Popover.Slot name="block-toolbar" ref={ blockToolbarRef } />
{ /* If there is no slot available, such as in the standalone block editor, render within the editor */ }
{ blockToolsSlot?.ref?.current ? (
<Fill name="__experimentalSelectedBlockTools">
<Popover.Slot
name="block-toolbar"
ref={ blockToolbarRef }
/>
</Fill>
) : (
<Popover.Slot
name="block-toolbar"
ref={ blockToolbarRef }
/>
) }
{ children }
{ /* Used for inline rich text popovers. */ }
<Popover.Slot
Expand Down

0 comments on commit 20ce22b

Please sign in to comment.