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

Blocks: Support reusable nested blocks (reusable blocks refactor) #5228

Merged
merged 17 commits into from
Mar 16, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Blocks: Avoid dismissing editable controls
In nested context, block selection changes from reusable block to the inner block being edited, but we want to keep the UI shown
  • Loading branch information
aduth authored and noisysocks committed Mar 14, 2018
commit 8501e7d9fbd2c12efd47d4f191543e7b00f03c7b
8 changes: 1 addition & 7 deletions blocks/library/block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ class ReusableBlockEdit extends Component {
}
}

componentWillReceiveProps( nextProps ) {
if ( this.props.focus && ! nextProps.focus ) {
this.stopEditing();
}
}

startEditing() {
this.setState( { isEditing: true } );
}
Expand Down Expand Up @@ -114,7 +108,7 @@ class ReusableBlockEdit extends Component {
return (
<Fragment>
{ element }
{ isSelected && (
{ ( isSelected || isEditing ) && (
<ReusableBlockEditPanel
isEditing={ isEditing }
title={ title !== null ? title : reusableBlock.title }
Expand Down