Skip to content

Commit bdf0f7f

Browse files
Merge pull request #69 from Relaticle/fix/action-dropdown-overlap
fix: close other action dropdowns when opening a new one
2 parents 6a587ca + 1cc2764 commit bdf0f7f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

resources/views/filament/pages/custom-fields-management.blade.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,25 @@
88
@endforeach
99
</x-filament::tabs>
1010

11-
<div class="custom-fields-component">
11+
<div class="custom-fields-component"
12+
x-data="{
13+
handleDropdownClick(e) {
14+
if (!this.$el.contains(e.target)) return;
15+
16+
const trigger = e.target.closest('.fi-dropdown-trigger');
17+
if (!trigger) return;
18+
19+
this.$el.querySelectorAll('.fi-dropdown').forEach(dropdown => {
20+
if (!dropdown.contains(trigger)) {
21+
const panel = dropdown.querySelector('[x-ref=panel]');
22+
if (panel && typeof panel.close === 'function') {
23+
panel.close();
24+
}
25+
}
26+
});
27+
}
28+
}"
29+
@mousedown.window="handleDropdownClick($event)">
1230
<div
1331
x-sortable
1432
wire:end.stop="updateSectionsOrder($event.target.sortable.toArray())"

0 commit comments

Comments
 (0)