Skip to content

Commit

Permalink
Block Editor: Disable click-through on desktop. (#17239)
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras authored Aug 28, 2019
1 parent 151d238 commit 1b9eed2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-editor/src/components/inner-blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -101,6 +102,7 @@ class InnerBlocks extends Component {

render() {
const {
isSmallScreen, // Temporary click-through disable on desktop.
clientId,
hasOverlay,
renderAppender,
Expand All @@ -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 (
Expand All @@ -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 {
Expand Down

0 comments on commit 1b9eed2

Please sign in to comment.