Skip to content

Commit

Permalink
[Experimental] Fix: add an unique id to each list item to prevent dif…
Browse files Browse the repository at this point in the history
…fing issue (#45304)

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

* chore: changelog
  • Loading branch information
dinhtungdu committed Mar 6, 2024
1 parent e2ed2a9 commit 2cfd120
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions plugins/woocommerce/changelog/fix-45300
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: [Experimental] Fix: add an unique id to each list item to prevent diffing issue


Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public static function render( $props ) {
// 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
id="<?php echo esc_attr( $item['id'] ); ?>"
class="wc-block-components-checkbox__input"
type="checkbox"
<input
id="<?php echo esc_attr( $item['id'] ); ?>"
class="wc-block-components-checkbox__input"
type="checkbox"
aria-invalid="false"
aria-label="<?php echo esc_attr( $i18n_label ); ?>"
data-wc-on--change--select-item="actions.selectCheckboxItem"
Expand Down

0 comments on commit 2cfd120

Please sign in to comment.