Skip to content

Commit 9b9a367

Browse files
arthur791004priethor
authored andcommitted
Post Editor: Set the default value of the editorTool to edit (#66636)
* Post Editor: Set the default value of the editorTool to edit * Change the condition of _showEmptyBlockSideInserter * Set the default value of the editorTool to "edit" for both post editor and site editor
1 parent a163905 commit 9b9a367

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

packages/block-editor/src/components/block-tools/use-show-block-tools.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ export function useShowBlockTools() {
4040
const _showEmptyBlockSideInserter =
4141
clientId &&
4242
! isTyping() &&
43-
editorMode === 'edit' &&
43+
// Hide the block inserter on the navigation mode.
44+
// See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.
45+
editorMode !== 'navigation' &&
4446
isEmptyDefaultBlock;
4547
const _showBlockToolbarPopover =
4648
! getSettings().hasFixedToolbar &&

packages/edit-post/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export function initializeEditor(
6262
dispatch( preferencesStore ).setDefaults( 'core', {
6363
allowRightClickOverrides: true,
6464
editorMode: 'visual',
65+
editorTool: 'edit',
6566
fixedToolbar: false,
6667
hiddenBlockTypes: [],
6768
inactivePanels: [],

packages/edit-post/src/index.native.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export function initializeEditor( id, postType, postId ) {
2929
welcomeGuide: true,
3030
} );
3131
dispatch( preferencesStore ).setDefaults( 'core', {
32+
editorTool: 'edit',
3233
hiddenBlockTypes: [],
3334
inactivePanels: [],
3435
openPanels: [ 'post-status' ],

packages/edit-site/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export function initializeEditor( id, settings ) {
6868
allowRightClickOverrides: true,
6969
distractionFree: false,
7070
editorMode: 'visual',
71+
editorTool: 'edit',
7172
fixedToolbar: false,
7273
focusMode: false,
7374
inactivePanels: [],

packages/edit-site/src/posts.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export function initializePostsDashboard( id, settings ) {
6565
allowRightClickOverrides: true,
6666
distractionFree: false,
6767
editorMode: 'visual',
68+
editorTool: 'edit',
6869
fixedToolbar: false,
6970
focusMode: false,
7071
inactivePanels: [],

0 commit comments

Comments
 (0)