Skip to content

Commit 518f42e

Browse files
authored
fix (global settings): not being applied in editor when it reopens in the site editor (#3514)
1 parent 05d4066 commit 518f42e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/plugins/get-editor-dom/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export const EditorDom = () => {
3838
return select( 'core/edit-site' )?.getEditedPostId?.()
3939
} )
4040

41+
// If in FSE, switching between the editor canvas and the navigation recreates the editor.
42+
const currentPage = useSelect( select => {
43+
return select( 'core/edit-site' )?.getPage?.()
44+
} )
45+
4146
// When switching between visual editor and code editor, the editor is recreated
4247
const editorMode = useSelect( select => {
4348
return select( 'core/edit-site' )?.getEditorMode() || select( 'core/edit-post' )?.getEditorMode()
@@ -98,7 +103,7 @@ export const EditorDom = () => {
98103
clearInterval( interval.current )
99104
clearTimeout( timeout.current )
100105
}
101-
}, [ deviceType, editorMode, editedSitePostId ] )
106+
}, [ deviceType, editorMode, editedSitePostId, currentPage ] )
102107

103108
useMemo( () => {
104109
const iframeEl = document.querySelector( `iframe[name="editor-canvas"]` )

0 commit comments

Comments
 (0)