rjsf-team/react-jsonschema-form

Nested if/then/else not initializing correctly

Open

#3872 aperta il 19 set 2023

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (2136 fork)batch import
dependencieshelp wantedif-then-else

Metriche repository

Star
 (13.175 star)
Metriche merge PR
 (Merge medio 3g 17h) (32 PR mergiate in 30 g)

Descrizione

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

Nested if/then behavior isn't initializing correctly

Example playground

The initial render has "animal" as blank and the dependent fields don't show up until Cat or Fish is selected. Once you select "Cat", the dependent field "food" shows up, but also "kind" and "favorite" show up, even though I don't expect them to. Once you select something from the food dropdown, the correct field disappears and the behavior is again as expected, until you select the empty option from the "food" dropdown.

Expected Behavior

Nested "then" properties would only show up once the "if" condition is met.

Steps To Reproduce

  1. Example playground
  2. Select "Cat"
  3. Notice "kind" and "favorite" both appear, even though they should only appear based on the selection of the "food" dropdown

Environment

- OS:
- Node:
- npm:

Anything else?

No response

Guida contributor