Skip to content

Form fields in autovalidate form are validated on the second build (but not the first) #15404

@Hixie

Description

@Hixie

If you have a TextFormField with a validator in a Form with autovalidate set to true, the validator is not evaluated when the form field is first created, but it is evaluated the next time the Form builds, even if that happens for unrelated reasons (e.g. an animation, or a reassemble during hot reload). So for example this means that hot-reloading an auto-validate form will make all the validators trigger and all the text fields turn red.

cc @HansMuller

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 1.17Found to occur in 1.17found in release: 1.20Found to occur in 1.20frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions