diff --git a/editor/modes/visual-editor/block.js b/editor/modes/visual-editor/block.js index 87ed2271c9881..dad6a6670cce9 100644 --- a/editor/modes/visual-editor/block.js +++ b/editor/modes/visual-editor/block.js @@ -136,7 +136,6 @@ class VisualEditorBlock extends Component { bindBlockNode( node ) { this.node = node; - this.props.blockRef( node ); } setAttributes( attributes ) { @@ -250,10 +249,7 @@ class VisualEditorBlock extends Component { } onFocus( event ) { - // Firefox retargets to parent with tabIndex. - const target = event.nativeEvent.explicitOriginalTarget || event.target; - - if ( target === this.node ) { + if ( event.target === this.node ) { this.props.onSelect(); } } @@ -334,16 +330,12 @@ class VisualEditorBlock extends Component { /* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */ return (
@@ -353,10 +345,15 @@ class VisualEditorBlock extends Component { { isFirstMultiSelected && } { isFirstMultiSelected && }
event.preventDefault() } onMouseDown={ this.onPointerDown } + onKeyDown={ this.onKeyDown } + onFocus={ this.onFocus } className="editor-visual-editor__block-edit" + tabIndex="0" + aria-label={ blockLabel } > { isValid && mode === 'visual' && ( diff --git a/editor/writing-flow/index.js b/editor/writing-flow/index.js index fd9b508076057..d3d2239d3f752 100644 --- a/editor/writing-flow/index.js +++ b/editor/writing-flow/index.js @@ -36,7 +36,7 @@ class WritingFlow extends Component { node.nodeName === 'INPUT' || node.nodeName === 'TEXTAREA' || node.contentEditable === 'true' || - node.classList.contains( 'editor-visual-editor__block' ) + node.classList.contains( 'editor-visual-editor__block-edit' ) ) ); }