From e563cec383f98f866a86b7eb87ed607ec83edafa Mon Sep 17 00:00:00 2001 From: Anuj-Rathore24 Date: Tue, 29 Oct 2024 19:06:16 +0530 Subject: [PATCH] feat: Fix Color changes to be in sync with rest of the block. --- packages/block-library/src/latest-comments/edit.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/block-library/src/latest-comments/edit.js b/packages/block-library/src/latest-comments/edit.js index 85e66cf2e9dc6..a526b9bd6e5d8 100644 --- a/packages/block-library/src/latest-comments/edit.js +++ b/packages/block-library/src/latest-comments/edit.js @@ -88,6 +88,13 @@ export default function LatestComments( { attributes, setAttributes } ) { // the block appears on the frontend. Setting the locale // explicitly prevents any middleware from setting it to 'user'. urlQueryArgs={ { _locale: 'site' } } + /** + * The `key` prop is set to a combination of `backgroundColor` and `textColor` attributes. + * This forces the component to update. + */ + key={ `${ attributes.backgroundColor || 'default' }-${ + attributes.textColor || 'default' + }` } />