Skip to content

Way to know whether remote function is redirecting us #15725

@Stadly

Description

@Stadly

Describe the problem

After a remote form function is executed, there is no way to know whether we are being redirected. A use case for this is to disable the form after submission. We can use form.pending to disable all the form controls while submitting, but the form controls will then be enabled again while we are being redirected.

Reproduction: https://www.sveltelab.dev/4q5x27lrbyj9y7n?files=.%2Fsrc%2Froutes%2F%2Bpage.svelte%2C.%2Fsrc%2Flib%2Fdata.remote.js

Describe the proposed solution

Some way to know whether we are being redirected. Maybe form.redirecting? Or it could be exposed in the return value of submit in enhance, but I don't think that would work for query and prerender.

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions