New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom callback for when submission is completed #371
Comments
This is already included in the timers, if a redirect result is returned, then the SvelteKit navigation store is used to clear the timers. If that doesn't work for you, something isn't right. Can you make a MRE? |
Here is a MRE: https://stackblitz.com/edit/superforms-2-testing-qcncdj?file=src%2Froutes%2F%2Bpage.svelte I wonder if it's because of the page transition? |
When I submit on the MRE, the spinner is visible up until the transition, isn't that how it's supposed to be? |
Well technically speaking I suppose yes, but it's a little jarring during a transition when the button state changes. I could just add a flag but was thinking of a cleaner way to do this as it's a common pattern for me, and I often already have |
Then I guess SvelteKit doesn't take transitions into account for the navigation store. Some future version of Superforms may have a custom callback for when the submission is determined to be completed, but not right now. :) |
$redirecting
Store
Is your feature request related to a problem? Please describe.
For example...if I am redirecting on login I want the loading spinner to stay
on
even though the form is donesubmitting
.Describe the solution you'd like
I think it would be cool to have
$redirecting
store, like$delayed
and$submitting
so we can easily track it.Describe alternatives you've considered
I could just easily add a flag
onResult
but I think it would be nice to have the Store easily accessible, like the others are.The text was updated successfully, but these errors were encountered: