Skip to content

Clean Fields after submit #435

@juanjogonzalez

Description

@juanjogonzalez

I have a strange behavior after submitting the form.

First time:

`const handleSubmit = async (e) => {
e.preventDefault();

    const formValid = simpleValidator.current.allValid();
    if (formValid) {
        setLoading(true);
        await sleep(2500);
    } else {
        simpleValidator.current.showMessages();
        forceUpdate(1);
    }
}`

const cb = () => { setLoading(false); setState(blankState); simpleValidator.current.hideMessages(); }

image

Work fine

But when complete the submit i'm trying to clean the messages with the cb function

image

after submit don't show the messages

image

only show the messages when put something in the field

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