Skip to content

Conditional oneOf options for select field are not rendered #249

Closed

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": {
      }
    }
  ]
}

Activity

  1. danielcardoso5 commented on Aug 7, 2026

    @danielcardoso5
    Collaborator

    Hey @denatys, thanks for reporting this!

    We have already shipped a few updates to v1 that fix the conditional options functionality:

    Latest release 1.2.15 already includes the changes above.

    What's currently missing is parsing properly the schema properties default keyword as you have in the schema ("default": "goods"). I have opened a new PR for it in #269 and it should ship soon.

  2. danielcardoso5 commented on Oct 7, 2026

    @danielcardoso5
    Collaborator

    All fixes are present since the 1.2.16 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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