Skip to content

Can setModel optionally set touched? #51

Description

@stephenwil

I've noticed that in the scenario where setModel is being called to populate the form model after an API called, the fields are still deemed 'untouched' and therefore any warnings, errors won't appear since the validation isn't run.
Rather than the application having to call setFieldToTouched for all the relevant fields, it would be handy if setModel did it

Activity

  1. stephenwil commented on Apr 9, 2018

    @stephenwil
    Author

    here's a PR #52

  2. vitkon commented on Apr 9, 2018

    @vitkon
    Owner

    validation runs all the time, it's your preference whether you display errors on touched fields only or not.
    It would be helpful if you can discuss the use-case a bit more so that I can replicate it somewhere like codesandbox.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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