File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -46,12 +46,15 @@ const GlobalSettingsLoader = () => {
4646 useEffect ( ( ) => {
4747 const editorBody = editorDom ?. closest ( 'body' )
4848 if ( editorBody ) {
49- editorBody . appendChild ( globalTypographyWrapper )
50- editorBody . appendChild ( globalColorWrapper )
51- editorBody . appendChild ( globalSpacingAndBorderWrapper )
52- editorBody . appendChild ( globalButtonsAndIconsWrapper )
53- editorBody . appendChild ( globalColorSchemesWrapper )
54- editorBody . appendChild ( globalPresetControlsWrapper )
49+ // No need to check for firstChild, since there will always be at least one
50+ // e.g. the post title wrapper and the actual root container.
51+ const firstChild = editorBody . firstChild
52+ editorBody . insertBefore ( globalTypographyWrapper , firstChild )
53+ editorBody . insertBefore ( globalColorWrapper , firstChild )
54+ editorBody . insertBefore ( globalSpacingAndBorderWrapper , firstChild )
55+ editorBody . insertBefore ( globalButtonsAndIconsWrapper , firstChild )
56+ editorBody . insertBefore ( globalColorSchemesWrapper , firstChild )
57+ editorBody . insertBefore ( globalPresetControlsWrapper , firstChild )
5558 }
5659 } , [ deviceType , editorDom ] )
5760
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export const ThemeBlockSize = () => {
2828 useEffect ( ( ) => {
2929 const editorBody = editorDom ?. closest ( 'body' )
3030 if ( editorBody ) {
31- editorBody . appendChild ( themeBlockSizeWrapper )
31+ editorBody . insertBefore ( themeBlockSizeWrapper , editorBody . firstChild )
3232 }
3333 } , [ deviceType , editorDom ] )
3434
You can’t perform that action at this time.
0 commit comments