diff --git a/admin/app/components/solidus_admin/ui/table/component.js b/admin/app/components/solidus_admin/ui/table/component.js index db605cca934..f9b2b0d935f 100644 --- a/admin/app/components/solidus_admin/ui/table/component.js +++ b/admin/app/components/solidus_admin/ui/table/component.js @@ -42,10 +42,13 @@ export default class extends Controller { } } - showSearch(event) { + showSearch({ detail: { focus } }) { this.modeValue = "search" this.render() - this.searchFieldTarget.focus() + + if (focus ?? true) { + this.searchFieldTarget.focus() + } } 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 106133d0292..5652c17e7c7 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 @@ -29,8 +29,9 @@ export default class extends Controller { } showSearch() { - if (this.isAnyCheckboxChecked()) - this.dispatch("showSearch") + if (this.isAnyCheckboxChecked()) { + this.dispatch("showSearch", { detail: { focus: false } }) + } } filterOptions(event) {