Upgrading from v2 to v3 or v4 breaks preselection in `anyOf` schema
See original GitHub issuePrerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I’m providing a couple of sample sandboxes demonstrating the issue.
Description
I’m not sure this is technically a bug, as I haven’t found the broken behaviour documented anywhere. But it does work in v2
, breaks in v3.0.0+
and I consider it an essential feature.
Here is a working v2.5.1
. sandbox … and here is a sandbox with identical code, but broken, because it runs on v3.0.0.
Steps to Reproduce
- Create an
anyOf
schema with two distinct types ofanyOf
items - Render a
<Form>
with this schema, andformData
exclusively corresponding to the second schema item
Expected (v2.5.1.
) behavior
Form renders with the second anyOf
item selected - the item matched by formData
Actual (v3.0.0
) behavior
Form always renders with the first anyOf
item selected - regardless of formData
not complying with the UI-selected schema
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
2.x Migration - react-jsonschema-form documentation
2.x Upgrade Guide¶. Changes from v1 -> v2¶. Breaking changes¶. We now officially support the @rjsf/material-ui theme. We use a monorepo with Lerna...
Read more >How to correctly preselect relevant rjsf `anyOf` item on <Form ...
So I found out that this behaviour works consistently on v2 of the package, and breaks fro v3. 0.0 . I have submitted...
Read more >[CT-599] [Bug] Upgrading from 1.0 to 1.1 breaks defer/state
We define a new method on the artifact class that (optionally) defines a set of "previous compatible" versions. For instance, the current ...
Read more >Azure PowerShell release notes - Microsoft Learn
Learn about all of the latest updates to the Azure PowerShell modules.
Read more >vSphere Update Manager Installation and Administration Guide
2 Installing, Upgrading, and Uninstalling Update Manager on a ... 4 Collect the Update Manager and vCenter Server Appliance Log Bundle 57.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@epicfaace I have no idea, I haven’t compared the code at all. But I suppose this part of migration docs might have something to do with it.
In this case it works on
v2.5.1
because the list of enums has only one value. When we add more than one values in enum, default value also breaks.@epicfaace I added a PR with test. Is there a way to fix this problem?