Skip to content

Cannot change property value with liveOmit and omitExtraData for arrays of objects and conditionality #4109

Closed
@anya92

Description

@anya92

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

I have a problem when trying to change property values using "liveOmit" and "omitExtraData". This is the JSON schema I use:

{
  "title": "Schema",
  "type": "object",
  "properties": {
    "array_of_objects": {
      "title": "Array of Objects",
      "type": "array",
      "items": {
        "$ref": "#/definitions/myArrayOfObjects"
      },
      "minItems": 1
    }
  },
  "definitions": {
    "myArrayOfObjects": {
      "title": "Array Item",
      "type": "object",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "booleanProperty": {
          "title": "Boolean Property",
          "default": true,
          "type": "boolean"
        }
      },
      "if": {
        "properties": {
          "booleanProperty": {
            "const": true
          }
        }
      },
      "then": {
        "properties": {
          "otherProperty": {
            "title": "Other Property",
            "type": "string",
            "enum": [
              "Hello",
              "World"
            ]
          }
        },
        "required": [
          "otherProperty"
        ]
      },
      "required": [
        "name"
      ]
    }
  }
}

Expected Behavior

It should be possible to change the otherProperty value.

Steps To Reproduce

  1. Go to the rjsf playground
  2. liveOmit and omitExtraData are already turned on, liveValidation is also turned on to see that the condition is valid
  3. try to change value of Other Property - nothing happens

Environment

- OS: macOS 14.2.1
- Node: 18.14.2
- npm: 9.5.0

Anything else?

It works in my project which uses version 5.12.1. But I can't update the package after it stopped working.
I already addressed this issue in #3909.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions