From c562ca9cf7e3e09ca0200bc8c612e26784f68ed0 Mon Sep 17 00:00:00 2001 From: epiqueras Date: Wed, 28 Aug 2019 08:56:23 -0700 Subject: [PATCH] Block Editor: Disable click-through on desktop. --- packages/block-editor/src/components/inner-blocks/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/inner-blocks/index.js b/packages/block-editor/src/components/inner-blocks/index.js index 2dad855bb4fc17..35e1bf10b47ca2 100644 --- a/packages/block-editor/src/components/inner-blocks/index.js +++ b/packages/block-editor/src/components/inner-blocks/index.js @@ -7,6 +7,7 @@ import classnames from 'classnames'; /** * WordPress dependencies */ +import { withViewportMatch } from '@wordpress/viewport'; // Temporary click-through disable on desktop. import { Component } from '@wordpress/element'; import { withSelect, withDispatch } from '@wordpress/data'; import { synchronizeBlocksWithTemplate, withBlockContentContext } from '@wordpress/blocks'; @@ -101,6 +102,7 @@ class InnerBlocks extends Component { render() { const { + isSmallScreen, // Temporary click-through disable on desktop. clientId, hasOverlay, renderAppender, @@ -114,7 +116,7 @@ class InnerBlocks extends Component { const isPlaceholder = template === null && !! templateOptions; const classes = classnames( 'editor-inner-blocks block-editor-inner-blocks', { - 'has-overlay': hasOverlay && ! isPlaceholder, + 'has-overlay': isSmallScreen && ( hasOverlay && ! isPlaceholder ), // Temporary click-through disable on desktop. } ); return ( @@ -137,6 +139,7 @@ class InnerBlocks extends Component { } InnerBlocks = compose( [ + withViewportMatch( { isSmallScreen: '< medium' } ), // Temporary click-through disable on desktop. withBlockEditContext( ( context ) => pick( context, [ 'clientId' ] ) ), withSelect( ( select, ownProps ) => { const {