How to validate a modal form before extraModalFooterActions runs?

I have a modal with a form and a custom footer button. I need to validate the form when this custom button is clicked, before its own logic runs.
However, the action's ->before() hook is never triggered, so I can't run validation.
Here is a simplified example of my code:

Action::make('formModal')
            ->form([
                \Filament\Forms\Components\TextInput::make('name')->rules('required')->markAsRequired(),
            ])
            ->modalSubmitAction(false) // Disable default submit button
            ->extraModalFooterActions([
                Action::make('confirmAction')
                    // PROBLEM: This hook is never called.
                    ->before(function () {
                        // I want to validate the 'name' field here,
                        // but this code never runs.
                        dd('This is never reached');
                    })
                    ->action(function () {
                        // This runs without validation.
                    }),
            ]),

Is there a way to validate the form before proceeding to the modal footer action? (I don't want to validate by ->required())
Was this page helpful?