Skip to content
Merged
Show file tree
Hide file tree
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
Optimizing the updating focus call
  • Loading branch information
youknowriad committed Apr 20, 2017
commit 56af22cb3dd2aefc105b8297938f74ee6be33b5a
2 changes: 1 addition & 1 deletion blocks/components/editable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default class Editable extends wp.element.Component {
this.initialize();
}

if ( this.props.focus !== prevProps.focus && this.props.focus ) {
if ( !! this.props.focus && ! prevProps.focus ) {
this.focus();
}

Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class VisualEditorBlock extends wp.element.Component {
attributes={ block.attributes }
setAttributes={ this.setAttributes }
insertBlockAfter={ onInsertAfter }
updateFocus={ onFocus }
setFocus={ onFocus }
/>
</div>
);
Expand Down