diff --git a/admin/app/components/solidus_admin/ui/table/component.js b/admin/app/components/solidus_admin/ui/table/component.js index 0e08ce4f22f..03bb282adbf 100644 --- a/admin/app/components/solidus_admin/ui/table/component.js +++ b/admin/app/components/solidus_admin/ui/table/component.js @@ -30,8 +30,8 @@ export default class extends Controller { } connect() { - this.element.addEventListener("ui--table--ransack-filter:showSearch", () => this.showSearch()) - this.element.addEventListener("ui--table--ransack-filter:search", () => this.search()) + this.element.addEventListener("showSearch", () => this.showSearch()) + this.element.addEventListener("search", () => this.search()) if (this.searchFieldTarget.value !== "") this.modeValue = "search" @@ -120,7 +120,7 @@ export default class extends Controller { } disconnect() { - this.element.removeEventListener("ui--table--ransack-filter:showSearch", () => this.showSearch()) - this.element.removeEventListener("ui--table--ransack-filter:search", () => this.search()) + this.element.removeEventListener("showSearch", () => this.showSearch()) + this.element.removeEventListener("search", () => this.search()) } } 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 e75c8425731..4450de5004f 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 @@ -28,7 +28,9 @@ export default class extends Controller { } showSearch() { - if (this.isAnyCheckboxChecked()) this.dispatch('showSearch') + if (this.isAnyCheckboxChecked()) { + this.element.dispatchEvent(new CustomEvent("showSearch", { bubbles: true })) + } } filterOptions(event) { @@ -39,7 +41,8 @@ export default class extends Controller { } search() { - this.dispatch('search') + this.element.dispatchEvent(new CustomEvent("search", { bubbles: true })) + this.highlightFilter() }