Skip to content

Commit

Permalink
Use Disabled element to prevent interaction with Archives Block edi…
Browse files Browse the repository at this point in the history
…tor view

Use of `pointer-events` to disable interaction was problematic. It
didn't disabled the dropdown version of the block and it doesn't prevent
keyboard interaction.

The Disabled component handles these situations.
  • Loading branch information
talldan committed Jul 16, 2018
1 parent 3677a65 commit 480338c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 4 additions & 3 deletions core-blocks/archives/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
PanelBody,
ServerSideRender,
ToggleControl,
Disabled,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';

Expand All @@ -18,8 +19,6 @@ import {
BlockControls,
} from '@wordpress/editor';

import './editor.scss';

class ArchivesBlock extends Component {
constructor() {
super( ...arguments );
Expand Down Expand Up @@ -75,7 +74,9 @@ class ArchivesBlock extends Component {
controls={ [ 'left', 'center', 'right' ] }
/>
</BlockControls>
<ServerSideRender key="archives" block="core/archives" attributes={ attributes } />
<Disabled>
<ServerSideRender key="archives" block="core/archives" attributes={ attributes } />
</Disabled>
</Fragment>
);
}
Expand Down
4 changes: 0 additions & 4 deletions core-blocks/archives/editor.scss

This file was deleted.

0 comments on commit 480338c

Please sign in to comment.