Skip to content
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

Clean Fields after submit #435

Open
juanjogonzalez opened this issue Oct 26, 2022 · 0 comments
Open

Clean Fields after submit #435

juanjogonzalez opened this issue Oct 26, 2022 · 0 comments

Comments

@juanjogonzalez
Copy link

juanjogonzalez commented Oct 26, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant