Prevent Modal Closing?

Within the tables component in a livewire component we have an action, that action renders a form with a view field. The view field renders a button with:
<button wire:click="downloadAttachment('{{ $invoice_id }}','{{ $file_name }}')">
<x-heroicon-o-document-arrow-down class="w-4 h-4 text-white-500 inline" /> Download
</button>
<button wire:click="downloadAttachment('{{ $invoice_id }}','{{ $file_name }}')">
<x-heroicon-o-document-arrow-down class="w-4 h-4 text-white-500 inline" /> Download
</button>
This works well, but on downloading the document the modal / sliderOver is closed. Is there a method we can place in the downloadAttachment function to prevent the modal/slideOver closing?
Solution:
Interesting. Maybe you need type="button" because it otherwise submits your form?
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch9mo ago
Interesting. Maybe you need type="button" because it otherwise submits your form?
toeknee
toekneeOP9mo ago
As per usual Dennis, on the money! Cheers buddy, complete oversight there.
Want results from more Discord servers?
Add your server