Skip to content

Fix multiple bugs related to switching between anyOf/oneOf options#1169

Merged
epicfaace merged 3 commits intomasterfrom
1168-oneof-missing-fields
Feb 21, 2019
Merged

Fix multiple bugs related to switching between anyOf/oneOf options#1169
epicfaace merged 3 commits intomasterfrom
1168-oneof-missing-fields

Conversation

@LucianBuzzo
Copy link
Copy Markdown
Collaborator

@LucianBuzzo LucianBuzzo commented Feb 6, 2019

Fixes #1168

  • Fixed a bug that would prevent input fields from rendering when
    switching between a non-object type option and an object type option
  • Fixed a bug where options would incorrectly change when entering
    values if a subschema with multiple required fields is used
  • Fixed a bug where switching from an object type option to a non-object
    type option would result in an input field containing the value [Object object]

Change-type: patch
Signed-off-by: Lucian lucian.buzzo@gmail.com

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
    • I've run npm run cs-format on my branch to conform my code to prettier coding style
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

Copy link
Copy Markdown
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I just have a few questions about understanding the logic. Would appreciate if you could explain those a bit more!

idSchema={idSchema[name]}
idPrefix={idPrefix}
formData={formData[name]}
formData={(formData || {})[name]}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what case(s) would formData be null?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formData can be null if you have just added an item to an array

Fixes #1168

- Fixed a bug that would prevent input fields from rendering when
switching between a non-object type option and an object type option
- Fixed a bug where options would incorrectly change when entering
values if a subschema with multiple required fields is used
- Fixed a bug where switching from an object tpye option to a non-object
type option would result in an input field containing the value [Object object]

Change-type: patch
Signed-off-by: Lucian <lucian.buzzo@gmail.com>
@LucianBuzzo
Copy link
Copy Markdown
Collaborator Author

@epicfaace Can you please re-review this PR when you have a chance?

@loctn
Copy link
Copy Markdown

loctn commented Feb 20, 2019

Do not mean to rush you @epicfaace , but excited for this fix to land ^_^.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants