Skip to content

Commit 3057a49

Browse files
committed
Implement close after click and ESC event for address menu
1 parent 0a55391 commit 3057a49

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

admin/app/components/solidus_admin/orders/show/address/component.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<%= tag.a(
2525
href: solidus_admin.send("order_#{@type}_address_path", @order, address_id: address.id),
2626
class: 'block text-black text-sm hover:bg-gray-50 p-2 mx-2 w-auto rounded-lg',
27+
'data-action': "#{stimulus_id}#close",
2728
) do %>
2829
<%= format_address(address) %>
2930
<% end %>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Controller } from '@hotwired/stimulus'
2+
3+
export default class extends Controller {
4+
static targets = ["addresses"]
5+
6+
close() {
7+
this.addressesTarget.removeAttribute('open')
8+
}
9+
}

0 commit comments

Comments
 (0)