question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading from v2 to v3 or v4 breaks preselection in `anyOf` schema

See original GitHub issue

Prerequisites

  • 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

  1. Create an anyOf schema with two distinct types of anyOf items
  2. Render a <Form> with this schema, and formData 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
michal-kurzcommented, Mar 21, 2022

@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.

0reactions
andreySimonenkocommented, Aug 23, 2022

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found