[Experimental] Fix: add an unique id to each list item to prevent diffing issue (#45304)

* fix: add an unique id to each list item to prevent diffing issue

* chore: changelog
This commit is contained in:
Tung Du 2024-03-06 10:36:20 +07:00 committed by GitHub
parent e2ed2a9fdb
commit 2cfd120f15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: [Experimental] Fix: add an unique id to each list item to prevent diffing issue

View File

@ -43,7 +43,7 @@ class CheckboxList {
// translators: %s: checkbox label.
$i18n_label = sprintf( __( 'Checkbox: %s', 'woocommerce' ), $item['aria_label'] ?? '' );
?>
<li>
<li data-wc-key="<?php echo esc_attr( $item['id'] ); ?>">
<div class="wc-block-components-checkbox">
<label for="<?php echo esc_attr( $item['id'] ); ?>">
<input