Closed BoGnY closed 3 weeks ago
👋 hi
Alternate between push and pushOnNextPage methods.
Hi, I've tried, but with pushOnNextPage the toast is shown only when refreshed, and is refreshed only if validation is ok, and this is not the case, because I need info toast even if validation fails.
The interested line is the 53, not the 39, sorry I didn't specify.
I've made a small video..
https://github.com/usernotnull/tall-toasts/assets/11542801/64e618b3-9c57-4bc3-94bf-5fda5050e606
As shown, "Salvato" appears with $this->dispatch('asset-saved')
(line 58) so after validation and saving, but together with toast which is put before validation..
Closed as is not a toast's bug but probably a livewire's bug: https://github.com/livewire/livewire/discussions/8598
Description
I have a form saving that require some seconds, so I try to put a info toast to inform user that I'm saving it... But the toast appears always after validation is done, even if I put the toast dispatch before starting validation..
Not sure if I'm doing something wrong 😞
To Reproduce
save
function withwire:click
save
function I put toast dispatch, form saving, then redirectWireToast
trait is presentExpected behavior
Toast dispatching was done when called, so before validation.
Screenshots
Additional context
I've tried three different code type, same result. As shown, toast dispatch is put before validation, (
$this->form->save()
call$this->validate()
in livewire form component), but toast is shown only when validation is completed