Skip to content

Commit

Permalink
SlotFill: Add passthrough prop as applied in #56779
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Jan 5, 2024
1 parent 5f4538b commit 9703258
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(
useBlockSync( props );

return (
<SlotFillProvider>
<SlotFillProvider passthrough>
<KeyboardShortcuts.Register />
<BlockRefsProvider>{ children }</BlockRefsProvider>
</SlotFillProvider>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/slot-fill/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const Slot = forwardRef( ( { bubblesVirtually, ...props }, ref ) => {
return <BaseSlot { ...props } />;
} );

export function Provider( { children, ...props } ) {
export function Provider( { children, passthrough = false, ...props } ) {
const parent = useContext( SlotFillContext );
if ( ! parent.isDefault ) {
if ( ! parent.isDefault && passthrough ) {
return children;
}
return (
Expand Down

0 comments on commit 9703258

Please sign in to comment.