F
Filament2mo ago
pratik

Any way to hide Action trigger button but not the action modal ?

This action modal auto opens when the page is loaded and the action trigger button sits at the render hook Body start on top of the page. How to hide it ?
public function onboardingAction()
{
return Action::make('onboarding')
->label('Change Password')
->form([
TextInput::make('password')
->label('Password')
->helperText('Create a new strong password for your account!')
->password()
->revealable()
->required(),
])
->closeModalByClickingAway(false)
->closeModalByEscaping(false)
->extraAttributes(['wire:init' => new HtmlString('mountAction(\'onboarding\')')])
->action(
function () {
$this->submit();
}
);
}
public function onboardingAction()
{
return Action::make('onboarding')
->label('Change Password')
->form([
TextInput::make('password')
->label('Password')
->helperText('Create a new strong password for your account!')
->password()
->revealable()
->required(),
])
->closeModalByClickingAway(false)
->closeModalByEscaping(false)
->extraAttributes(['wire:init' => new HtmlString('mountAction(\'onboarding\')')])
->action(
function () {
$this->submit();
}
);
}
`
4 Replies
LeandroFerreira
LeandroFerreira2mo ago
I think in your view you can use <div wire:init="mountAction('onboarding')"></div> instead of rendering the action button
public function render()
{
return <<<'HTML'
<div wire:init="mountAction('onboarding')">
<x-filament-actions::modals />
</div>
HTML;
}
public function render()
{
return <<<'HTML'
<div wire:init="mountAction('onboarding')">
<x-filament-actions::modals />
</div>
HTML;
}
pratik
pratikOP2mo ago
Thanks boss 😇 setting defaultAction didn't work in v3.
LeandroFerreira
LeandroFerreira2mo ago
I think $defaultAction works on pages

Did you find this page helpful?