Skip to content

fix: close other action dropdowns when opening a new one#69

Merged
ManukMinasyan merged 1 commit into2.xfrom
fix/action-dropdown-overlap
Jan 19, 2026
Merged

fix: close other action dropdowns when opening a new one#69
ManukMinasyan merged 1 commit into2.xfrom
fix/action-dropdown-overlap

Conversation

@ManukMinasyan
Copy link
Collaborator

Summary

  • Fixes overlapping ActionGroup dropdowns on the custom fields management page
  • When clicking one dropdown, any previously opened dropdown now closes automatically

Problem

When clicking the action group (3 dots) for a field, then clicking on the action group for a section above, both dropdowns remained open and overlapped.

Solution

Added Alpine.js coordination that:

  • Listens for mousedown events within the component
  • Closes any open dropdown panels when a new dropdown trigger is clicked
  • Uses scoped selectors (this.$el) to avoid affecting other page dropdowns
  • Leverages Alpine's lifecycle for automatic cleanup (no memory leaks)
  • Avoids private Alpine APIs for stability

Test plan

  • Click field dropdown → opens; Click section dropdown → field closes, section opens
  • Click section dropdown → opens; Click field dropdown → section closes, field opens
  • Click outside any dropdown → closes normally
  • Edit/Deactivate/Delete actions still work correctly
  • User menu and other page dropdowns are NOT affected

Add Alpine.js coordination to close other ActionGroup dropdowns when
a new one is opened. This prevents multiple dropdowns from overlapping
on the custom fields management page.

The solution:
- Uses scoped event handling within the component
- Leverages Alpine's lifecycle for automatic cleanup
- Avoids private APIs for stability
Copilot AI review requested due to automatic review settings January 15, 2026 20:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to fix overlapping ActionGroup dropdowns on the custom fields management page by adding Alpine.js coordination logic to close previously opened dropdowns when a new one is clicked.

Changes:

  • Added Alpine.js x-data directive with a handleDropdownClick function to the custom-fields-component div
  • Implemented mousedown event listener to detect dropdown trigger clicks and close other open dropdowns
  • Used CSS class selectors to query and manipulate Filament dropdown elements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ManukMinasyan ManukMinasyan merged commit bdf0f7f into 2.x Jan 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants