Skip to content

Conditional oneOf options for select field are not rendered #249

Description

@denatys

In v1, a select field (uom) that relies on conditional oneOf definitions inside allOf (if/then) renders without any options.
The same schema worked correctly in v0.

Expected Behavior

When:
• type = "service" → uom select should display service-related options
• type = "goods" → uom select should display goods-related options

The dropdown should dynamically populate based on the selected type.

Actual Behavior (v1)

The uom field renders as a select input, but:
• No options are visible when the dropdown is opened
• The field is required, but user cannot select any value

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "type": {
      "type": "string",
      "title": "Type",
      "default": "goods",
      "oneOf": [
        {
          "const": "goods",
          "title": "Goods"
        },
        {
          "const": "service",
          "title": "Service"
        }
      ],
      "x-jsf-presentation": {
        "inputType": "radio"
      }
    },
    "uom": {
      "title": "UoM",
      "type": "string",
      "x-jsf-presentation": {
        "inputType": "select",
        "gridColumn": 5,
        "size": "sm"
      }
    }
  },
  "required": [
    "type",
    "uom"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "type": {
            "const": "service"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "properties": {
          "uom": {
            "oneOf": [
              {
                "const": "each",
                "title": "each"
              },
              {
                "const": "year",
                "title": "year"
              },
              {
                "const": "month",
                "title": "month"
              },
              {
                "const": "week",
                "title": "week"
              },
              {
                "const": "day",
                "title": "day"
              },
              {
                "const": "hour",
                "title": "hour"
              },
              {
                "const": "project",
                "title": "project"
              }
            ]
          }
        }
      },
      "else": {
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "goods"
          }
        },
        "required": [
          "type"
        ]
      },
      "then": {
        "properties": {
          "uom": {
            "oneOf": [
              {
                "const": "each",
                "title": "each"
              },
              {
                "const": "1/2 cubic yard",
                "title": "1/2 cubic yard"
              },
              {
                "const": "assembly",
                "title": "assembly"
              },
              {
                "const": "bag",
                "title": "bag"
              },
              {
                "const": "bale",
                "title": "bale"
              }
            ]
          }
        }
      },
      "else": {
      }
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions