Can't get extraModalFooterActions to work

Hi. I can't seem to get ->extraModalFooterActions working. When I use Filament\Forms\Components\Actions\Action I get an Typed property Filament\Forms\Components\Actions\Action::$component must not be accessed before initialization exception:
{
return $form
->schema([
TextInput::make('test_input')
->required(),

Actions::make([
Action::make('test')
->action(function () {
//
})
->modal()
->modalHeading('Test')
->extraModalFooterActions([
\Filament\Forms\Components\Actions::make('extraActionTest')
->requiresConfirmation()
->action(function () {
dd('test');
}),
])
])

]);
}
{
return $form
->schema([
TextInput::make('test_input')
->required(),

Actions::make([
Action::make('test')
->action(function () {
//
})
->modal()
->modalHeading('Test')
->extraModalFooterActions([
\Filament\Forms\Components\Actions::make('extraActionTest')
->requiresConfirmation()
->action(function () {
dd('test');
}),
])
])

]);
}
And when I use Filament\Actions\Action the button appears but doesn't open a modal or execute the code in ->action():
{
return $form
->schema([
TextInput::make('test_input')
->required(),

Actions::make([
Action::make('test')
->action(function () {
//
})
->modal()
->modalHeading('Test')
->extraModalFooterActions([
\Filament\Actions\Action::make('extraActionTest')
->requiresConfirmation()
->action(function () {
dd('test');
}),
])
])

]);
}
{
return $form
->schema([
TextInput::make('test_input')
->required(),

Actions::make([
Action::make('test')
->action(function () {
//
})
->modal()
->modalHeading('Test')
->extraModalFooterActions([
\Filament\Actions\Action::make('extraActionTest')
->requiresConfirmation()
->action(function () {
dd('test');
}),
])
])

]);
}
11 Replies
binaryfire
binaryfire3mo ago
Am I missing something obvious?
awcodes
awcodes3mo ago
Is this in a custom page?
binaryfire
binaryfire3mo ago
It's the profile page Custom EditProfile
awcodes
awcodes3mo ago
Is it the simple profile page? I’m not seeing anything obviously wrong with the code.
binaryfire
binaryfire3mo ago
I haven't checked out those the new profile options. Is simple the one without the sidebar? That's what mine is.
awcodes
awcodes3mo ago
Yes, that’s the simple one. Try ->profile(isSimple: false) Just wondering if the simple one doesn’t have the modals component.
binaryfire
binaryfire3mo ago
Same problem unfortunately. Primary actions / modals work fine. I just can't get secondary ones (inside extraModalFooterActions) working. Is Filament\Forms\Components\Actions\Action the right class to be using here?
awcodes
awcodes3mo ago
Honestly I’m not sure. I would think it would be the regular action since it’s not actually inside the modal’s form.
binaryfire
binaryfire3mo ago
Just tried it in a resource, same issue. I wonder if there's a bug when trying to do this inside anonymous actions. I'll see if I can reproduce it in a clean project
awcodes
awcodes3mo ago
It’s possible.
binaryfire
binaryfire3mo ago
GitHub
extraModalFooterActions not working properly inside anonymous act...
Package filament/filament Package Version 3.2.47 Laravel Version 10.3.3 Livewire Version 3.4.8 PHP Version 8.3 Problem description Actions inside the ->extraModalFooterActions() method of anonym...
Want results from more Discord servers?
Add your server
More Posts