Skip to content

Validation errors not disappearing #52

Open
@Thorarin

Description

@Thorarin

I'm seeing some unexpected behavior when I trigger validation on a button press:

onSave = async (event: React.MouseEvent<HTMLButtonElement>) => {
        event.preventDefault();

        // I need to add this call, otherwise all the validation messages from
        // the previous submission attempt stay, even though the offending
        // input fields are fixed.
        this.form.current.reset();

        await this.form.current.validateForm();
        if (!this.form.current.isValid()) {
            console.log('Form invalid');
            return;
        }

        // Continue processing...
}

The examples don't have this reset() call, so I'm wondering what could cause this type of behavior?
I can't think of anything "special" I did in my form that would cause this.

I'm using version 0.15.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions