diff --git a/admin/app/components/solidus_admin/orders/show/component.html.erb b/admin/app/components/solidus_admin/orders/show/component.html.erb index 24788b4ba73..671e3ae256a 100644 --- a/admin/app/components/solidus_admin/orders/show/component.html.erb +++ b/admin/app/components/solidus_admin/orders/show/component.html.erb @@ -1,4 +1,4 @@ -<%= page do %> +<%= page("data-action": "turbo:before-cache@window->#{stimulus_id}#closeMenus") do %> <%= page_header do %> <%= page_header_back(solidus_admin.orders_path) %> <%= page_header_title(t('.title', number: @order.number)) %> diff --git a/admin/app/components/solidus_admin/orders/show/component.js b/admin/app/components/solidus_admin/orders/show/component.js index 6839d36996e..6c6056ac26d 100644 --- a/admin/app/components/solidus_admin/orders/show/component.js +++ b/admin/app/components/solidus_admin/orders/show/component.js @@ -1,5 +1,7 @@ import { Controller } from '@hotwired/stimulus' export default class extends Controller { - + closeMenus() { + this.event.querySelectorAll('details').forEach(details => details.removeAttribute('open')); + } }