Modal opened without Action
is it possible to use something like this:
public function openModalAction(): Action
{
return Action::make('openModalAction')
->modalHeading('Title')
->modalSubheading('subtitle')
->modalContent(view('modals.view'))
->modalButton('Close')
->action(fn () => null);
}
Without using a button?
I created a Livewire Component and im using a section as a button. Can i open a modal ? He is not a "button" to use the Action.
thanks
3 Replies
maybe use js sto do so
i do that. thats the approach im using atm.
public function openModal(): void
{
$this->dispatch('open-modal', id: 'id-modal');
}
but the thing is:
with this approach, the CSS used by the modal is not the same we use when we set the Action::make()
Unfortunately I don't think that's possible with action modals. Modal IDs are random - they use the Livewire id.
Eg.
data-fi-modal-id="fi-CM5G36NzThLhI0h8EnI2-action-0"