Experimental: Prevent diffing error using key for each router region of Chips and Checkbox List (#52210)
This commit is contained in:
parent
9314a022de
commit
7bd713c5ed
|
@ -0,0 +1,5 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
Comment: Experimental: Fix diffing error for Checkbox List and Chips blocks.
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ final class ProductFilterCheckboxList extends AbstractBlock {
|
||||||
$wrapper_attributes = array(
|
$wrapper_attributes = array(
|
||||||
'data-wc-interactive' => esc_attr( $namespace ),
|
'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-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 ),
|
'class' => esc_attr( $classes ),
|
||||||
'style' => esc_attr( $style ),
|
'style' => esc_attr( $style ),
|
||||||
);
|
);
|
||||||
|
|
|
@ -54,6 +54,7 @@ final class ProductFilterChips extends AbstractBlock {
|
||||||
$wrapper_attributes = array(
|
$wrapper_attributes = array(
|
||||||
'data-wc-interactive' => esc_attr( $namespace ),
|
'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-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 ),
|
'class' => esc_attr( $classes ),
|
||||||
'style' => esc_attr( $style ),
|
'style' => esc_attr( $style ),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue