Skip to content

Allow resetting form based on remote function result. #14787

@motherthestate

Description

@motherthestate

Describe the problem

I am using a remote function to login with enhance. The issue is enhance keeps my form values even after e redirect, meaning the values will be back when I sign out and land on the login page again.

I could fix it by using the enhance callback's form.reset() but I cannot conditionally reset based on the my remote function's result since it is not returned from submit. Also the docs wrap it in a try catch but submit never seems to throw an error even when using invalid().

Describe the proposed solution

Using enhance, I don't know if there really is a good reason to keep form values after a redirect. But, maybe I missed a better way of doing it.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions