From 0b421dc18f438e1a06c29e452f308fb1c1021165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Fri, 30 Apr 2021 16:33:27 +0300 Subject: [PATCH] Enable device preview --- packages/edit-post/src/components/visual-editor/index.js | 7 +++++-- packages/edit-post/src/store/selectors.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/edit-post/src/components/visual-editor/index.js b/packages/edit-post/src/components/visual-editor/index.js index aaa75900f89c8b..b2dd1f647a0787 100644 --- a/packages/edit-post/src/components/visual-editor/index.js +++ b/packages/edit-post/src/components/visual-editor/index.js @@ -60,7 +60,7 @@ function MaybeIframe( { children, contentRef, isTemplateMode, styles } ) { head={ } ref={ ref } contentRef={ contentRef } - style={ { width: '100%', height: '100%' } } + style={ { width: '100%', height: '100%', display: 'block' } } > { children } @@ -113,7 +113,10 @@ export default function VisualEditor( { styles } ) { ? templateModeStyles : desktopCanvasStyles; if ( resizedCanvasStyles ) { - animatedStyles = resizedCanvasStyles; + animatedStyles = { + ...resizedCanvasStyles, + paddingBottom: null, + }; } const contentRef = useMergeRefs( [ diff --git a/packages/edit-post/src/store/selectors.js b/packages/edit-post/src/store/selectors.js index eece40da2f56c0..a1db999ea12667 100644 --- a/packages/edit-post/src/store/selectors.js +++ b/packages/edit-post/src/store/selectors.js @@ -313,7 +313,7 @@ export function isSavingMetaBoxes( state ) { * @return {string} Device type. */ export function __experimentalGetPreviewDeviceType( state ) { - return state.isEditingTemplate ? 'Desktop' : state.deviceType; + return state.deviceType; } /**