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

Duplicate text input above nested oneOf #3412

Closed
4 tasks done
CiaranMn opened this issue Jan 30, 2023 · 2 comments · Fixed by #3414
Closed
4 tasks done

Duplicate text input above nested oneOf #3412

CiaranMn opened this issue Jan 30, 2023 · 2 comments · Fixed by #3414
Assignees
Labels
any-one-all-of Related to fixing anyOf, oneOf or allOf bug

Comments

@CiaranMn
Copy link

CiaranMn commented Jan 30, 2023

Prerequisites

What theme are you using?

core

Version

5.0.0-beta.20

Current Behavior

When oneOf appears in a nested schema, a text input appears above the multi-field.

Playground link

Sample schema

{
  "type": "object",
  "properties": {
    "stringOrNumber": {
      "oneOf": [
        {
          "type": "string",
          "title": "String"
        },
        {
          "type": "number",
          "title": "Number"
        }
      ]
    }
  }
}

Screenshot 2023-01-30 at 09 51 35

Expected Behavior

The additional input does not appear.

Steps To Reproduce

See playground link / sample schema

Environment

- OS: macOS
- Node: 16.16.0
- npm: 8.11.0
@CiaranMn CiaranMn added bug needs triage Initial label given, to be assigned correct labels and assigned labels Jan 30, 2023
@heath-freenome
Copy link
Member

Ah, this is caused by #3392, specifically the fix for #1654. I will try and figure out how to avoid this within the scope of an object while still supporting it for the main use case.

@heath-freenome heath-freenome self-assigned this Jan 30, 2023
@heath-freenome heath-freenome added any-one-all-of Related to fixing anyOf, oneOf or allOf and removed needs triage Initial label given, to be assigned correct labels and assigned labels Jan 30, 2023
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Jan 30, 2023
…#3412

Fixes: rjsf-team#3412 by reverting the last change made to `getSchemaType()`

The type inference from `anyOf`/`oneOf` that was added to fix rjsf-team#1654 actually caused a worse bug, and without it the inference now happens properly due to other fixes somehow

- In `@rjsf/utils`, reverted the type inference from `anyOf`/`oneOf`
- Updated the `CHANGELOG.md` accordingly
heath-freenome added a commit that referenced this issue Jan 30, 2023
Fixes: #3412 by reverting the last change made to `getSchemaType()`

The type inference from `anyOf`/`oneOf` that was added to fix #1654 actually caused a worse bug, and without it the inference now happens properly due to other fixes somehow

- In `@rjsf/utils`, reverted the type inference from `anyOf`/`oneOf`
- Updated the `CHANGELOG.md` accordingly
@CiaranMn
Copy link
Author

Thanks @heath-freenome!

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 bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants