From 1a25aec8d12fdad376cb8c50daade570cd0c2d4c Mon Sep 17 00:00:00 2001 From: Ella Date: Thu, 18 Jan 2024 20:44:20 +0100 Subject: [PATCH 1/2] Block editor: don't register shortcut for 'inert' editor --- .../block-editor/src/components/block-preview/index.js | 1 + packages/block-editor/src/components/provider/index.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/block-preview/index.js b/packages/block-editor/src/components/block-preview/index.js index 0fb7f55b9955d2..4a838b04f144ac 100644 --- a/packages/block-editor/src/components/block-preview/index.js +++ b/packages/block-editor/src/components/block-preview/index.js @@ -70,6 +70,7 @@ export function BlockPreview( { { - const { children, settings, stripExperimentalSettings = false } = props; + const { + children, + settings, + stripExperimentalSettings = false, + inert, + } = props; const { __experimentalUpdateSettings } = unlock( useDispatch( blockEditorStore ) @@ -46,7 +51,7 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider( return ( - + { ! inert && } { children } ); From db65d2e188795adb8a4ed7ed1ed873c0ab184adc Mon Sep 17 00:00:00 2001 From: Ella Date: Fri, 19 Jan 2024 21:12:06 +0100 Subject: [PATCH 2/2] Use __unstableIsPreviewMode --- .../src/components/block-preview/index.js | 1 - .../block-editor/src/components/provider/index.js | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/block-editor/src/components/block-preview/index.js b/packages/block-editor/src/components/block-preview/index.js index 4a838b04f144ac..0fb7f55b9955d2 100644 --- a/packages/block-editor/src/components/block-preview/index.js +++ b/packages/block-editor/src/components/block-preview/index.js @@ -70,7 +70,6 @@ export function BlockPreview( { { - const { - children, - settings, - stripExperimentalSettings = false, - inert, - } = props; + const { children, settings, stripExperimentalSettings = false } = props; const { __experimentalUpdateSettings } = unlock( useDispatch( blockEditorStore ) @@ -51,7 +46,9 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider( return ( - { ! inert && } + { ! settings.__unstableIsPreviewMode && ( + + ) } { children } );