Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try another approach to fixing the sibling inserter in Firefox #7530

Merged
merged 4 commits into from Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions editor/components/block-list/insertion-point.js
Expand Up @@ -27,6 +27,7 @@ class BlockInsertionPoint extends Component {
onFocusInserter( event ) {
// We stop propagation of the focus event to avoid selecting the current block
// While we're trying to insert a new block
// We also attach this to onMouseDown, due to a difference in behavior in Firefox and Safari, where buttons don't receive focus: https://gist.github.com/cvrebert/68659d0333a578d75372
event.stopPropagation();

this.setState( {
Expand Down Expand Up @@ -65,6 +66,7 @@ class BlockInsertionPoint extends Component {
onClick={ this.onClick }
label={ __( 'Insert block' ) }
onFocus={ this.onFocusInserter }
onMouseDown={ this.onFocusInserter }
onBlur={ this.onBlurInserter }
/>
</div>
Expand Down