Skip to content

Commit

Permalink
Merge pull request #3443 from vahonc/3431-elasticsuite-catalog-attrib…
Browse files Browse the repository at this point in the history
…ute-filter-onclick-events-2.10-fix

[Catalog] Fix #3431, replacing 'onclick' with an inline function to bind the click events
  • Loading branch information
rbayet authored Nov 28, 2024
2 parents 3018a00 + 558ddda commit 06c9f8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<?php if ($filterItem->getCount() > 0): ?>
<a href="<?php echo $block->escapeUrl($filterItem->getUrl()) ?>">
<?php if ($this->isMultipleSelectEnabled()) : ?>
<input type="checkbox" onclick="this.parentNode.click();" <?php if($filterItem->getIsSelected()) : ?>checked<?php endif; ?> />
<input type="checkbox" data-bind="click: function(data, event) { event.target.parentNode.click(); return true; }" <?php if($filterItem->getIsSelected()) : ?>checked<?php endif; ?> />
<?php endif; ?>
<?php /* @escapeNotVerified */ echo $filterItem->getLabel() ?>
<?php if ($this->helper('\Magento\Catalog\Helper\Data')->shouldDisplayProductCountOnLayer()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<li class="item">
<a data-bind="attr: {href:url, rel:$parent.displayRelNofollow}, visible: count >= 1">
<input type="checkbox"
data-bind="checked: is_selected, attr: {id: id}"
onclick="this.parentNode.click();" />
data-bind="checked: is_selected, attr: {id: id}, click: function(data, event) { event.target.parentNode.click(); return true; }" />
<label data-bind="attr: {for: id}">
<span data-bind="text: label"></span>
<span class="count" data-bind="text: count, visible: $parent.displayProductCount"></span>
Expand Down

0 comments on commit 06c9f8c

Please sign in to comment.