Skip to content

Validation behavior with dependent fields #4311

@BlackBerryID

Description

@BlackBerryID

Prerequisites

What theme are you using?

core

Version

5.21.1

Current Behavior

onSubmit: validate all fields
onChange: dependent fields aren't validated (as a result these fields loose error state)

Expected Behavior

onChange doesn't make dependent fields with errors loose thier error state if they haven't been changed

Steps To Reproduce

  1. Open example: https://playcode.io/2018348
  2. Choose yes in "showSecondBlock" field
  3. Click on submit button (secondBlock's fileds got errors)
  4. Go to "name" field of firstBlock object
  5. Type some text (secondBlock's fields loose thier errors)

Environment

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions