From 3efd79f3fbd9c970cfaf69d5856adeedbbffcbf1 Mon Sep 17 00:00:00 2001 From: Rainer Dema Date: Wed, 15 Nov 2023 14:04:11 +0100 Subject: [PATCH] Add generic controller for closing details on outside click Implemented a new Stimulus controller for `
` elements and applied it to the address form. This generic controller leverages the `useClickOutside` hook from `stimulus-use` to automatically close the `
` when a click is detected outside its boundaries. Co-Authored-By: Elia Schito --- .../orders/show/address/component.html.erb | 2 +- .../solidus_admin/controllers/details_controller.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 admin/app/javascript/solidus_admin/controllers/details_controller.js diff --git a/admin/app/components/solidus_admin/orders/show/address/component.html.erb b/admin/app/components/solidus_admin/orders/show/address/component.html.erb index bca9503c1ba..695307b4767 100644 --- a/admin/app/components/solidus_admin/orders/show/address/component.html.erb +++ b/admin/app/components/solidus_admin/orders/show/address/component.html.erb @@ -10,7 +10,7 @@ <% if @user&.addresses&.any? %> -
-target="addresses"> +
-target="addresses" class="text-black text-sm">