diff --git a/admin/app/components/solidus_admin/ui/table/ransack_filter/component.js b/admin/app/components/solidus_admin/ui/table/ransack_filter/component.js index 8774870d2ea..82c1084a7cd 100644 --- a/admin/app/components/solidus_admin/ui/table/ransack_filter/component.js +++ b/admin/app/components/solidus_admin/ui/table/ransack_filter/component.js @@ -6,6 +6,7 @@ export default class extends Controller { connect() { this.setCheckboxesFromUrlParams() + this.highlightFilter() useClickOutside(this) } @@ -59,4 +60,12 @@ export default class extends Controller { container.appendChild(checkbox.closest('div')) }) } + + highlightFilter() { + const optionIsSelected = this.optionTargets.some((option) => { + return option.querySelector("input[type=checkbox]").checked + }) + + this.summaryTarget.classList.toggle("bg-gray-100", optionIsSelected) + } }