Commit e53ba3b 1 parent 9b48e86 commit e53ba3b Copy full SHA for e53ba3b
File tree 2 files changed +7
-0
lines changed
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export function initializeEditor(
49
49
settings ,
50
50
initialEdits
51
51
) {
52
+ const isMediumOrBigger = window . matchMedia ( '(min-width: 782px)' ) . matches ;
52
53
const target = document . getElementById ( id ) ;
53
54
const root = createRoot ( target ) ;
54
55
@@ -77,7 +78,9 @@ export function initializeEditor(
77
78
78
79
// Check if the block list view should be open by default.
79
80
// If `distractionFree` mode is enabled, the block list view should not be open.
81
+ // This behavior is disabled for small viewports.
80
82
if (
83
+ isMediumOrBigger &&
81
84
select ( preferencesStore ) . get ( 'core' , 'showListViewByDefault' ) &&
82
85
! select ( preferencesStore ) . get ( 'core' , 'distractionFree' )
83
86
) {
Original file line number Diff line number Diff line change @@ -22,14 +22,18 @@ import { TEMPLATE_POST_TYPE } from '../utils/constants';
22
22
export const setCanvasMode =
23
23
( mode ) =>
24
24
( { registry, dispatch } ) => {
25
+ const isMediumOrBigger =
26
+ window . matchMedia ( '(min-width: 782px)' ) . matches ;
25
27
registry . dispatch ( blockEditorStore ) . __unstableSetEditorMode ( 'edit' ) ;
26
28
dispatch ( {
27
29
type : 'SET_CANVAS_MODE' ,
28
30
mode,
29
31
} ) ;
30
32
// Check if the block list view should be open by default.
31
33
// If `distractionFree` mode is enabled, the block list view should not be open.
34
+ // This behavior is disabled for small viewports.
32
35
if (
36
+ isMediumOrBigger &&
33
37
mode === 'edit' &&
34
38
registry
35
39
. select ( preferencesStore )
You can’t perform that action at this time.
0 commit comments