Is there anyway to delay a redirect after a successful form submission? #1655
Replies: 2 comments 3 replies
-
The redirect is automatically Made by Inertia because of the X-Inertia-Location header. |
Beta Was this translation helpful? Give feedback.
-
Interesting question! Right now when an Inertia response comes back from the server, Inertia transitions to that new page immediately. There isn't any way to delay that from happening when navigating to a different page. Closing a dialog is an interesting use-case. Not even sure how I'd go about handling this. Part of me thinks we could create the ability to register some type of callback that can be run before navigating away, which could include a delay in it. TLDR; Not possible today, but an interesting idea for a future improvement to the project. |
Beta Was this translation helpful? Give feedback.
-
I'm using the React adapter with Laravel and I have a modal where:
useForm
helper.The question is, can I delay the redirect until the modal is closed?
I'm toggling the modal's state in the
onSuccess
event of the form, but it seems to just redirect immediately.Beta Was this translation helpful? Give feedback.
All reactions