Skip to content

Commit

Permalink
Block Editor: Add __experimentalUIParts.hasPopover option. (#19922)
Browse files Browse the repository at this point in the history
To allow disabling the block popover (which includes the block toolbar and inserter).
  • Loading branch information
yansern authored Feb 6, 2020
1 parent cf1a6d0 commit fd1da51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/block-editor/src/components/block-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function BlockList( {
'block-editor-block-list__layout',
className
) }
hasPopover={ __experimentalUIParts.hasPopover }
>
{ blockClientIds.map( ( clientId, index ) => {
const isBlockInSelection = hasMultiSelection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function onDragStart( event ) {
}
}

function RootContainer( { children, className }, ref ) {
function RootContainer( { children, className, hasPopover = true }, ref ) {
const {
selectedBlockClientId,
hasMultiSelection,
Expand Down Expand Up @@ -82,7 +82,7 @@ function RootContainer( { children, className }, ref ) {
containerRef={ ref }
>
<BlockNodes.Provider value={ useState( {} ) }>
<BlockPopover />
{ hasPopover ? <BlockPopover /> : null }
<div
ref={ ref }
className={ className }
Expand Down

0 comments on commit fd1da51

Please sign in to comment.