I have this
<div wire:loading>
loading.....
</div>
component:
public function doMySubmit(){
//something slow
return redirect('/');
}
problem is, that loading stops once the redirect gets returned to the browser, the redirect means though that the browser just STARTS to redirect.
So on doMySubmit I show a splash screen, but once the redirect, it disappears and the form becomes editable again at least until the redirect response gets an answer and the browser starts to paint the new page.
any fix?
The mechanics of Livewire does not work like this. It only shows a loading indicator until the request is resolved. What you can do, is make the loading logic yourself, by introducing a loading-variable like this:
public $loading = false;
public function doMySubmit() {
$this->loading = true;
return redirect('/');
}
@if($loading)
<div>
loading.....
</div>
@endif