Commit 3242ca9 1 parent e3f3c3d commit 3242ca9 Copy full SHA for 3242ca9
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
@@ -76,7 +77,9 @@ export function initializeEditor(
76
77
77
78
// Check if the block list view should be open by default.
78
79
// If `distractionFree` mode is enabled, the block list view should not be open.
80
+ // This behavior is disabled for small viewports.
79
81
if (
82
+ isMediumOrBigger &&
80
83
select ( preferencesStore ) . get ( 'core' , 'showListViewByDefault' ) &&
81
84
! select ( preferencesStore ) . get ( 'core' , 'distractionFree' )
82
85
) {
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