simple-react-validator icon indicating copy to clipboard operation
simple-react-validator copied to clipboard

Clean Fields after submit

Open juanjogonzalez opened this issue 2 years ago • 0 comments

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

juanjogonzalez avatar Oct 26 '22 23:10 juanjogonzalez