diff --git a/plugins/woocommerce/changelog/fix-checkbox-list-chip-diffing-error b/plugins/woocommerce/changelog/fix-checkbox-list-chip-diffing-error new file mode 100644 index 00000000000..4835bbb5942 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-checkbox-list-chip-diffing-error @@ -0,0 +1,5 @@ +Significance: patch +Type: fix +Comment: Experimental: Fix diffing error for Checkbox List and Chips blocks. + + diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterCheckboxList.php b/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterCheckboxList.php index 9cc900a4952..0a6cd957c05 100644 --- a/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterCheckboxList.php +++ b/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterCheckboxList.php @@ -55,6 +55,7 @@ final class ProductFilterCheckboxList extends AbstractBlock { $wrapper_attributes = array( 'data-wc-interactive' => esc_attr( $namespace ), 'data-wc-context' => wp_json_encode( $checkbox_list_context, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP ), + 'data-wc-key' => wp_unique_prefixed_id( $this->get_full_block_name() ), 'class' => esc_attr( $classes ), 'style' => esc_attr( $style ), ); diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterChips.php b/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterChips.php index dec171c98f9..638ca6e218b 100644 --- a/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterChips.php +++ b/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterChips.php @@ -54,6 +54,7 @@ final class ProductFilterChips extends AbstractBlock { $wrapper_attributes = array( 'data-wc-interactive' => esc_attr( $namespace ), 'data-wc-context' => wp_json_encode( $checkbox_list_context, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP ), + 'data-wc-key' => wp_unique_prefixed_id( $this->get_full_block_name() ), 'class' => esc_attr( $classes ), 'style' => esc_attr( $style ), );