Skip to content
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
Set formats state only if changed
  • Loading branch information
aduth committed Apr 26, 2017
commit ea5a642fc56988adffb36adc1673849bb3a53d9e
6 changes: 4 additions & 2 deletions blocks/components/editable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import { last } from 'lodash';
import { last, isEqual } from 'lodash';
import { Parser as HtmlToReactParser } from 'html-to-react';
import { Fill } from 'react-slot-fill';

Expand Down Expand Up @@ -165,7 +165,9 @@ export default class Editable extends wp.element.Component {
return result;
}, {} );

this.setState( { formats } );
if ( ! isEqual( this.state.formats, formats ) ) {
this.setState( { formats } );
}
}

bindEditorNode( ref ) {
Expand Down