filament icon indicating copy to clipboard operation
filament copied to clipboard

Nested modal actions don’t open when the parent action is inside a Schema (Form/Infolist)

Open eugenpasca opened this issue 2 months ago • 2 comments

Package

filament/filament

Package Version

v4.1.7

Laravel Version

v12.33.0

Livewire Version

v3.6.4

PHP Version

PHP 8.4.8

Problem description

Nested modal actions defined via extraModalFooterActions() fail to open when the parent action is rendered inside a Schema (either Form or Infolist).

When clicking a nested footer action, the modal closes or triggers a re-render, but the new modal never opens. However, the exact same action chain works correctly when placed in getHeaderActions() (or outside of any Schema).

This behavior occurs even on a fresh Laravel 12 + Livewire 4 + Filament 4.x install, using the example from the official documentation.

Expected behavior

Each nested modal action inside extraModalFooterActions() should:

  • Open its own modal (supporting multi-level nesting),
  • Maintain state and mounted actions,
  • Work consistently whether the parent action is defined inside a Schema (Form/Infolist) or as a header action.

In short: nested modal actions should behave identically in all contexts.

Steps to reproduce

  1. Create a fresh Laravel 12 app with Livewire 4 and Filament 4.x.
  2. Define an action inside a Schema (e.g. Infolist or Form) that opens a modal and includes nested actions in the footer.
  3. Example:

class UserForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([

                Actions::make([

                    Action::make('first')
                          ->schema([
                              TextInput::make('foo'),
                          ])
                          ->action(function () {
                              // ...
                          })
                          ->extraModalFooterActions([
                              Action::make('second')
                                    ->schema([
                                        TextInput::make('bar'),
                                    ])
                                    ->arguments(['number' => 2])
                                    ->action(function () {
                                        // ...
                                    })
                                    ->extraModalFooterActions([
                                        Action::make('third')
                                              ->schema([
                                                  TextInput::make('baz'),
                                              ])
                                              ->arguments(['number' => 3])
                                              ->action(function () {
                                                  // ...
                                              })
                                              ->extraModalFooterActions([
                                                  Action::make('fourth')
                                                        ->requiresConfirmation()
                                                        ->action(function (array $mountedActions) {
                                                            dd(
                                                                $mountedActions[0]->getRawData(),
                                                                $mountedActions[0]->getArguments(),
                                                                $mountedActions[1]->getRawData(),
                                                                $mountedActions[1]->getArguments(),
                                                                $mountedActions[2]->getRawData(),
                                                                $mountedActions[2]->getArguments(),
                                                            );
                                                            // ...
                                                        }),
                                              ]),
                                    ]),
                          ]),
                ]),
            ]);
    }
}
  1. Open the first modal and click the footer actions in sequence.
  2. The first modal opens fine, but any subsequent footer action fails to open its modal.
  3. Move the exact same code to getHeaderActions() — everything works properly.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/hehecoding/test-laravel

Relevant log output


eugenpasca avatar Oct 14 '25 07:10 eugenpasca

A helpful PR would be to enhance tests/src/Actions/ActionTest.php with extra nested action tests that fail. Then I can fix the failing tests. Are you able to do that?

danharrin avatar Oct 14 '25 08:10 danharrin

Thank you for checking it, I'll try to create the test + PR next week.

eugenpasca avatar Oct 15 '25 20:10 eugenpasca