Skip to content

Commit

Permalink
Avoid remounting the block if it supports colors
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 22, 2020
1 parent 36ddce1 commit 99d6a8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-editor/src/hooks/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ export const withColorPaletteStyles = createHigherOrderComponent(
return select( 'core/block-editor' ).getSettings();
}, [] );

if ( ! hasColorSupport( name ) || ! ( backgroundColor || textColor ) ) {
if ( ! hasColorSupport( name ) ) {
return <BlockListBlock { ...props } />;
}

const extraStyles = {
color: textColor
? getColorObjectByAttributeValues( colors, textColor )?.color
Expand Down

0 comments on commit 99d6a8a

Please sign in to comment.