Skip to content

Commit

Permalink
Remove IgnoreNestedEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 3, 2020
1 parent a5cb167 commit 48389d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 169 deletions.
23 changes: 3 additions & 20 deletions packages/block-editor/src/components/block-list-appender/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { getDefaultBlockName } from '@wordpress/blocks';
/**
* Internal dependencies
*/
import IgnoreNestedEvents from '../ignore-nested-events';
import DefaultBlockAppender from '../default-block-appender';
import ButtonBlockAppender from '../button-block-appender';

Expand Down Expand Up @@ -51,26 +50,10 @@ function BlockListAppender( {
);
}

// IgnoreNestedEvents is used to treat interactions within the appender as
// subject to the same conditions as those which occur within nested blocks.
// Notably, this effectively prevents event bubbling to block ancestors
// which can otherwise interfere with the intended behavior of the appender
// (e.g. focus handler on the ancestor block).
//
// A `tabIndex` is used on the wrapping `div` element in order to force a
// focus event to occur when an appender `button` element is clicked. In
// some browsers (Firefox, Safari), button clicks do not emit a focus event,
// which could cause this event to propagate unexpectedly. The `tabIndex`
// ensures that the interaction is captured as a focus, without also adding
// an extra tab stop.
//
// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
return (
<IgnoreNestedEvents childHandledEvents={ [ 'onFocus', 'onClick', 'onKeyDown' ] }>
<div tabIndex={ -1 } className="block-list-appender">
{ appender }
</div>
</IgnoreNestedEvents>
<div tabIndex={ -1 } className="block-list-appender">
{ appender }
</div>
);
}

Expand Down
95 changes: 0 additions & 95 deletions packages/block-editor/src/components/ignore-nested-events/index.js

This file was deleted.

This file was deleted.

0 comments on commit 48389d4

Please sign in to comment.