Open hardevine opened 5 months ago
same here
workaround used with sweetalert's loader system:
// livewire-alert.php config
'showLoaderOnConfirm' => true,
'allowOutsideClick' => false,
public function confirmSubmit()
{
$this->confirm('are you sure ?', [
//'onConfirm' => 'confirmed',
'preConfirm'=> 'formSubmitPreConfirm',
]);
}
async function formSubmitPreConfirm (event) {
Livewire.dispatch('confirmed');
return new Promise(resolve => setTimeout(resolve, 10000));
};
// event dispatched so ajax can start while loader is spinning
I'm using confirm dialog with sweetalert Loaders don't work unless i use __dispatch method in target for form submission. If there are multiple forms on page i can't separate them