Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using oneOf/dependencies default is not being populated #1416

Closed
3 tasks done
TrevorSundberg opened this issue Aug 17, 2019 · 4 comments
Closed
3 tasks done

When using oneOf/dependencies default is not being populated #1416

TrevorSundberg opened this issue Aug 17, 2019 · 4 comments
Assignees
Labels
any-one-all-of Related to fixing anyOf, oneOf or allOf defaults dependencies

Comments

@TrevorSundberg
Copy link

TrevorSundberg commented Aug 17, 2019

Prerequisites

Description

Default value does not appear when adding a value, using a combo of array, oneOf, and dependencies:
https://mozilla-services.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6eyJjb21wb25lbnRzIjpbeyJ0eXBlbmFtZSI6IkEifV19LCJzY2hlbWEiOnsicHJvcGVydGllcyI6eyJjb21wb25lbnRzIjp7Iml0ZW1zIjp7ImRlcGVuZGVuY2llcyI6eyJ0eXBlbmFtZSI6eyJvbmVPZiI6W3sicHJvcGVydGllcyI6eyJkYXRhIjp7InR5cGUiOiJvYmplY3QiLCJwcm9wZXJ0aWVzIjp7ImV4YW1wbGUiOnsidHlwZSI6InN0cmluZyIsImRlZmF1bHQiOiJ0ZXN0In19fSwidHlwZW5hbWUiOnsiZW51bSI6WyJBIl19fX0seyJwcm9wZXJ0aWVzIjp7ImRhdGEiOnsidHlwZSI6Im9iamVjdCIsInByb3BlcnRpZXMiOnsiZXhhbXBsZSI6eyJ0eXBlIjoic3RyaW5nIiwiZGVmYXVsdCI6InRlc3QifX19LCJ0eXBlbmFtZSI6eyJlbnVtIjpbIkIiXX19fV19fSwicHJvcGVydGllcyI6eyJ0eXBlbmFtZSI6eyJlbnVtIjpbIkEiLCJCIl0sInR5cGUiOiJzdHJpbmcifX0sInJlcXVpcmVkIjpbInR5cGVuYW1lIl0sInR5cGUiOiJvYmplY3QifSwidHlwZSI6ImFycmF5In19LCJ0eXBlIjoib2JqZWN0In0sInVpU2NoZW1hIjp7fX0=

Steps to Reproduce

  1. Click the above link in the playground.
  2. Remove and add a component
  3. Select type A or B
  4. Observe that the default value of test for field example is not populated.

Expected behavior

Expect the default value to appear in the example field.

Actual behavior

The example field is always empty and no default value is populated.

Version

"react-jsonschema-form": "^1.7.0",

@TrevorSundberg TrevorSundberg changed the title oneOf default When using oneOf/dependencies default is not being populated Aug 17, 2019
@TrevorSundberg
Copy link
Author

I would also just mention that I saw this PR was completed: #1338 which is the reason I upgraded to 1.7.0, but this behavior is still occuring and occurs on the playground too (assuming the playground is running 1.7.0...)

@MatinF
Copy link

MatinF commented Aug 24, 2019

This would be really nice to get resolved, it would greatly simplify our form process

@epicfaace epicfaace self-assigned this Aug 24, 2019
@epicfaace
Copy link
Member

epicfaace commented Sep 9, 2019

This will actually be fixed by #1376 -- see the following test case: https://github.com/rjsf-team/react-jsonschema-form/pull/1376/files#diff-0de170772e45d2602c103dd916607787R862

And the following playground links:
first example
second example

@newt10 newt10 added multiSchema and removed oneof labels Sep 3, 2021
@heath-freenome heath-freenome added the any-one-all-of Related to fixing anyOf, oneOf or allOf label Sep 29, 2022
@heath-freenome
Copy link
Member

This cannot be reproduced any more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
any-one-all-of Related to fixing anyOf, oneOf or allOf defaults dependencies
Projects
None yet
Development

No branches or pull requests

5 participants