Skip to content

Commit

Permalink
[Catalog] Fix #3431, replacing 'onclick' with an inline function to b…
Browse files Browse the repository at this point in the history
…ind the click events
  • Loading branch information
vahonc committed Nov 28, 2024
1 parent 3018a00 commit 558ddda
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 558ddda

Please sign in to comment.