github rjsf-team/react-jsonschema-form v6.7.0
6.7.0

8 hours ago

New feature

  • We added CyclicSchemaField and CyclicSchemaExpandTemplate to prevent infinite cyclic expansion of schemas. If you want to override the UI for this, you can customize your own CyclicSchemaExpandTemplate
  • Added new nestedDefaultPrecedence option to experimental_defaultFormStateBehavior

@rjsf/antd

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/chakra-ui

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/core

  • Fixed #3907 and #4262 as follows:
    • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
    • Added CyclicSchemaField to the list of fields, that renders the CyclicSchemaExpandTemplate initially and, if expanded, will render the SchemaField with the RJSF_REF_CYCLE_KEY tag turned off
    • Updated SchemaForm to render the CyclicSchemaField when the schema contains the RJSF_REF_CYCLE_KEY set to true
  • Fixed array fields with empty tuple items and schema-valued additionalItems so clicking add renders the additional item field, fixing #3791
  • Added a warning when a select widget schema default is not present in the enum options, fixing #4494
  • Fixed SchemaField so that a schema with a primitive or array type alongside a non-select oneOf/anyOf no longer renders a spurious duplicate input above the option selector, fixing #5119
  • Fixed MultiSchemaField to propagate the parent schema's type to option sub-schemas that don't define their own, so the correct widget (e.g. StringField) renders for the selected option instead of FallbackField, fixing #5119
  • Fixed nested constAsDefaults values being skipped in matching conditional allOf schemas, fixing #4963
  • Fixed processPendingChange so that clearing a string field that has a schema default value no longer re-applies the default, fixing #5125
  • Fixed a regression introduced in #5136 where clearing a second field caused a previously-cleared field to be re-populated with its schema default; uses JSON.parse(JSON.stringify(...)) to strip undefined-valued keys from formData before AJV validation so that the #4518 fix is preserved
  • Show selected option descriptions, fixing (#4214)
  • Fixed ObjectField's "Add" button for additionalProperties schemas containing a $ref so the new item's default value is computed via getDefaultFormState() against the fully-resolved referenced schema (recursively populating nested defaults) instead of only reading the resolved schema's own top-level default, which discarded the sibling default and any nested property defaults, fixing #4266

@rjsf/daisyui

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/fluentui-rc

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/mantine

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/mui

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/primereact

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/react-bootstrap

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/semantic-ui

  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Show selected option descriptions, fixing (#4214)

@rjsf/shadcn

  • Updated the single select trigger to use native button semantics with expanded and disabled state coverage, fixing #4764 (#5117)
  • Added CyclicSchemaExpandTemplate to the list of templates for the theme, updating snapshots accordingly
  • Fixed a small visual bug that caused hovering over items of FancySelect and FancyMultiSelect that have the same label to incorrectly highlight more than one element, fixing #5126
  • Fixed CommandItem value handling in FancySelect and FancyMultiSelect components to ensure values are passed as strings (#5155)
  • Show selected option descriptions, fixing (#4214)

@rjsf/utils

  • Updated types.ts to add CyclicSchemaExpandProps type and CyclicSchemaExpandTemplate in the TemplatesType
  • Updated resolveAllReferences() to add a new markCycleOnDetection prop which adds RJSF_REF_CYCLE_KEY marker (from constants.ts) to a schema that has been detected to have a cycle, partially fixing #3907
  • Updated hashForSchema() to filter keys to remove RJSF_REF_KEY prefixed keys before hashing the schema
  • Updated enums.ts to add ExpandButton and CycleDetected keys
  • Updated isFixedItems() to treat empty tuple items arrays as fixed items so additionalItems schemas are handled consistently, fixing #3791
  • Added logUnsupportedDefaultForEnum() helper for theme select widgets to warn when a schema default is not present in the enum options, fixing #4494
  • Fixed retrieveSchema() to preserve boolean conditional branches while resolving schemas, fixing #4476 (#5101)
  • Updated Experimental_DefaultFormStateBehavior to add a new nestedDefaultsPrecedence option
  • Updated getDefaultFormState() to use the new nestedDefaultsPrecedence option to control how defaults defined on multiple levels are merged together, fixing #5089
  • Updated omitExtraData() to better handle allOfs containing multiple if/then/else blocks, matching fix in SJSF, fixing #5142
  • Fixed optionsList() to preserve an explicitly empty string title on oneOf/anyOf options instead of falling back to the option's value, fixing #4448
  • Show selected option descriptions, fixing (#4214)
  • Fixed getDefaultFormState() so that optional array defaults are not initialized when experimental_defaultFormStateBehavior.arrayMinItems.populate = never, fixing #5149

@rjsf/validator-ajv8

  • Updated transformRJSFValidationErrors() to detect field name for allOf and if-then-else by falling back to the root schema to find the title, fixing #5134

@rjsf/validator-ata

  • Updated transformRJSFValidationErrors() to detect field name for allOf and if-then-else by falling back to the root schema to find the title, fixing #5134
  • Updated the ata-validator dependency to ^1.0.0, its first stable release; no API changes for @rjsf/validator-ata consumers (#5157)

Dev / docs / playground

  • Updated @rjsf/snapshots to add a test case to formTests that verifies the new Cycle detection UI
  • Updated the custom-templates.md and custom-widgets-fields.md for the new feature
  • Updated utility-functions.md to document logUnsupportedDefaultForEnum()
  • Updated the playground to add a selector for the nestedDefaultsPrecedence option
  • Replaced npm with pnpm v10 for development

Don't miss a new react-jsonschema-form release

NewReleases is sending notifications on new releases.