From 0afd8ed35c3220cc137704e4327b4a9cae1826c4 Mon Sep 17 00:00:00 2001 From: Nik Tsekouras Date: Tue, 4 Jul 2023 13:46:21 +0300 Subject: [PATCH] Site Editor Frame: Ignore Spotlight in view mode (#52262) --- .../block-editor/use-site-editor-settings.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/edit-site/src/components/block-editor/use-site-editor-settings.js b/packages/edit-site/src/components/block-editor/use-site-editor-settings.js index af3f5ccba3498..4241c7f55cb67 100644 --- a/packages/edit-site/src/components/block-editor/use-site-editor-settings.js +++ b/packages/edit-site/src/components/block-editor/use-site-editor-settings.js @@ -12,11 +12,13 @@ import { unlock } from '../../lock-unlock'; import inserterMediaCategories from './inserter-media-categories'; export default function useSiteEditorSettings( templateType ) { - const { storedSettings } = useSelect( ( select ) => { - const { getSettings } = unlock( select( editSiteStore ) ); - + const { storedSettings, canvasMode } = useSelect( ( select ) => { + const { getSettings, getCanvasMode } = unlock( + select( editSiteStore ) + ); return { storedSettings: getSettings(), + canvasMode: getCanvasMode(), }; }, [] ); @@ -70,6 +72,7 @@ export default function useSiteEditorSettings( templateType ) { const { __experimentalAdditionalBlockPatterns, __experimentalAdditionalBlockPatternCategories, + focusMode, ...restStoredSettings } = storedSettings; @@ -86,6 +89,7 @@ export default function useSiteEditorSettings( templateType ) { // active for all entities. templateLock: false, template: false, + focusMode: canvasMode === 'view' && focusMode ? false : focusMode, }; - }, [ storedSettings, blockPatterns, blockPatternCategories ] ); + }, [ storedSettings, blockPatterns, blockPatternCategories, canvasMode ] ); }