open modal on page load
I have a modal that has a trigger button and opens fine from the trigger button, but I also want to be able to conditionally open it when the page loads. I'm trying right now to just open it on the render method, but it won't open. It's literally stupid simple and I can't figure out why it wouldn't be working:
(The modal is itself another livewire component)
and my modal:
<x-filament::modal id="statement-mapping" width="6xl">...
my parent is extending the Page class and uses HasForms, HasActions, InteractsWithForms, InteractsWithActions
. The modal livewire class (child) is also using the same contracts/traits.Solution:Jump to solution
This is how I do also in my current project. You can insert a renderhook at the bottom of the content make a livewire component and put it inside the render hook blade:
```php
<?php
...
7 Replies
try opening modal in the mount intead of render
I tried that, it's not working 😦
Maybe this helps you. This is from a current project. There may or may not be side effects of the current use. So your milage may very: This is on my
ListTransaction::class
(in my case I check if the current url contains &openTransactionId=xxx) if thats the case i call the view action.
Thanks for the help, I'll give it a try.
Solution
This is how I do also in my current project. You can insert a renderhook at the bottom of the content make a livewire component and put it inside the render hook blade:
now then inside your livewire component blade this is what I do:
I maybe complicate things so it works for me
full livewire blade
this worked for me, thanks!