Skip to content

Commit

Permalink
Add <CopyHandler> to WidgetAreasBlockEditorProvider (#33166)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel authored Jul 5, 2021
1 parent cc70361 commit f8ec9ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
BlockTools,
BlockSelectionClearer,
BlockInspector,
CopyHandler,
ObserveTyping,
WritingFlow,
BlockEditorKeyboardShortcuts,
Expand Down Expand Up @@ -114,15 +115,19 @@ export default function SidebarBlockEditor( {
isFixedToolbarActive={ isFixedToolbarActive }
/>

<BlockTools>
<BlockSelectionClearer>
<WritingFlow>
<ObserveTyping>
<BlockList renderAppender={ BlockAppender } />
</ObserveTyping>
</WritingFlow>
</BlockSelectionClearer>
</BlockTools>
<CopyHandler>
<BlockTools>
<BlockSelectionClearer>
<WritingFlow>
<ObserveTyping>
<BlockList
renderAppender={ BlockAppender }
/>
</ObserveTyping>
</WritingFlow>
</BlockSelectionClearer>
</BlockTools>
</CopyHandler>

{ createPortal(
// This is a temporary hack to prevent button component inside <BlockInspector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useMemo } from '@wordpress/element';
import {
BlockEditorProvider,
BlockEditorKeyboardShortcuts,
CopyHandler,
} from '@wordpress/block-editor';
import { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';

Expand Down Expand Up @@ -108,7 +109,7 @@ export default function WidgetAreasBlockEditorProvider( {
useSubRegistry={ false }
{ ...props }
>
{ children }
<CopyHandler>{ children }</CopyHandler>
<ReusableBlocksMenuItems rootClientId={ widgetAreaId } />
</BlockEditorProvider>
</SlotFillProvider>
Expand Down

0 comments on commit f8ec9ee

Please sign in to comment.