Run javascript when modal opened

I have a map that needs resized once a modal is launched or else its size is incorrect. How can run a small js method when the modal is launched?
2 Replies
Mark Chaney
Mark ChaneyOP16mo ago
hmm, mountUsing() might work ah, tried that with dispatching a browser event, but cant get the timing right. hmm
Patrick Boivin
Patrick Boivin16mo ago
Are you on Livewire v2 or v3? (IIRC you have a project on Filament v3-alpha, I could be wrong...) If the event handler seems to run too early, you can try to delay it a bit:
x-on:my-event.window="$nextTick(() => /* handle event here */)"
x-on:my-event.window="$nextTick(() => /* handle event here */)"
Want results from more Discord servers?
Add your server