Skip to content

Selector not working inside dependency for uncontrolled components #1394

@snirp

Description

@snirp

Prerequisites

Description

The select input inside a schema dependency is not working as intended. The default value is ignored and it is not possible to select a single choice. When there are multiple choices, the workaround is to first change the value and then back to the initial.

Steps to Reproduce

This is best viewed in the provided sample: https://codesandbox.io/s/github/snirp/schemadebug

  • Form A: inside "select2" the value of "option2A" is displayed, but this value is not actually selected. Only "select1" is actually submitted and no validation errors are triggered (although "select2" is a required field. Toggling between "option2A" and "option2B" can be used as a workaround.

  • Form B: the same issue, but the workaround is not available, since there are no choices to toggle between. This is a particularly nasty situation we encountered.

  • Form C: the defaults are provided through formData. This is the workaround we are using.

Expected behavior

Should work just as select input outside the dependency

Actual behavior

See the provided codesandbox

Version

^1.7.0

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