Skip to content

Conversation

@leek
Copy link
Contributor

@leek leek commented Feb 2, 2026

Summary

  • Adds an opt-in overlayParentActions() method on child actions that keeps the parent modal visible when the child opens on top
  • Without the flag, the default close/reopen behavior is unchanged
  • CSS raises stacked child modals to z-50 (above parent's z-40) and lightens the child backdrop to avoid double-darkness

Supersedes #19163. Resolves #19166.

Usage

Action::make('editItems')
    ->slideOver()
    ->schema([
        Repeater::make('items')
            ->deleteAction(
                static fn (Action $action) => $action->overlayParentActions(),
            ),
    ])
    ->action(function () {
        // ...
    })

Changes

File What
HasParentActions.php New $shouldOverlayParentActions property, overlayParentActions() setter, shouldOverlayParentActions() getter
InteractsWithActions.php syncActionModals() dispatches overlayParentActions flag from mounted action
modals.js Skip closeModal() only when flag is true AND nesting depth is increasing
modal.css z-50 stacking + lighter child backdrop for sibling .fi-modal-open elements
02-modals.md New "Overlaying child actions on top of parent actions" docs section

Test plan

  • Open a slide-over with a repeater, click delete on an item with ->overlayParentActions() → confirmation dialog stacks on top, slide-over stays visible
  • Same scenario without ->overlayParentActions() → default close/reopen behavior unchanged
  • Dismissing the child action returns focus to the still-open parent
  • composer test:phpstan passes (pre-existing env issue on local, CI should be clean)

leek added 2 commits February 2, 2026 06:32
When a nested action (e.g. repeater delete confirmation) opens inside a
slide-over, the parent modal was closed first — making it feel like the
user lost their work. The parent would reopen after the child dismissed,
but the jarring close/reopen cycle was a poor experience.

Skip the close when action nesting depth is increasing. The parent stays
visible and the child renders on top via z-index stacking. When the child
closes, the parent is already open and the existing open-modal guard
(! isOpen) prevents a redundant reopen.

CSS changes raise stacked child modals to z-50 (above the parent's z-40)
and lighten the child backdrop to avoid double-darkness.
Adds an opt-in `overlayParentActions()` method to child actions that
keeps the parent modal visible when the child opens on top. Without this
flag, the default close/reopen behavior is unchanged.

The JS nesting guard now only skips closing the parent modal when the
action explicitly opts in via `overlayParentActions()` AND nesting depth
is increasing. CSS z-index stacking and lighter child backdrop from the
prior commit support the visual layering.
@github-project-automation github-project-automation bot moved this to Todo in Roadmap Feb 2, 2026
@danharrin danharrin added enhancement New feature or request pending review labels Feb 2, 2026
@danharrin danharrin added this to the v4 milestone Feb 2, 2026
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Roadmap Feb 3, 2026
@danharrin danharrin merged commit 342ba9d into filamentphp:4.x Feb 3, 2026
23 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Roadmap Feb 3, 2026
@leek leek deleted the fix/stacked-action-modals-v2 branch February 3, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants