Skip to content

Commit

Permalink
Use __unstableIsPreviewMode
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 19, 2024
1 parent 1a25aec commit db65d2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function BlockPreview( {
<ExperimentalBlockEditorProvider
value={ renderedBlocks }
settings={ settings }
inert={ true }
>
<AutoHeightBlockPreview
viewportWidth={ viewportWidth }
Expand Down
11 changes: 4 additions & 7 deletions packages/block-editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ import KeyboardShortcuts from '../keyboard-shortcuts';

export const ExperimentalBlockEditorProvider = withRegistryProvider(
( props ) => {
const {
children,
settings,
stripExperimentalSettings = false,
inert,
} = props;
const { children, settings, stripExperimentalSettings = false } = props;

const { __experimentalUpdateSettings } = unlock(
useDispatch( blockEditorStore )
Expand All @@ -51,7 +46,9 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(

return (
<SlotFillProvider passthrough>
{ ! inert && <KeyboardShortcuts.Register /> }
{ ! settings.__unstableIsPreviewMode && (
<KeyboardShortcuts.Register />
) }
<BlockRefsProvider>{ children }</BlockRefsProvider>
</SlotFillProvider>
);
Expand Down

0 comments on commit db65d2e

Please sign in to comment.