Prerequisites
What theme are you using?
core
Version
6.x
Current Behavior
When a property is defined as allOf: [{ "$ref": "..." }] instead of a direct $ref,
the default declared in the referenced subschema is not populated into formData,
even with experimental_defaultFormStateBehavior.allOf: "populateDefaults" enabled.
On top of that, the select widget visually displays Cat - the first enum option -
while formData is {}. So the UI shows a selection the form data does not contain.
Expected Behavior
allOf: [{ $ref }] and a bare $ref are semantically equivalent for a single-element
allOf, so both should produce formData = { "animal": "Dog" }.
- Independently of (1): the widget should never display an enum option that is not
present in formData. When the value is undefined it should render an empty /
placeholder selection rather than silently falling back to the first enum entry.
Steps To Reproduce
Schema that works - formData becomes { "animal": "Dog" }:
{
"type": "object",
"properties": {
"animal": { "title": "Animal", "$ref": "#/definitions/Animal" }
},
"required": ["animal"],
"definitions": {
"Animal": { "type": "string", "enum": ["Cat", "Dog", "Bird"], "default": "Dog" }
}
}
Same schema with the $ref wrapped in allOf - formData stays {}:
{
"type": "object",
"properties": {
"animal": { "title": "Animal", "allOf": [{ "$ref": "#/definitions/Animal" }] }
},
"required": ["animal"],
"definitions": {
"Animal": { "type": "string", "enum": ["Cat", "Dog", "Bird"], "default": "Dog" }
}
}
- Open the playground link below (start with empty
formData).
- Set
experimental_defaultFormStateBehavior.allOf to populateDefaults.
- Observe that the select shows
Cat while formData remains {}, whereas the
$ref variant shows Dog and yields { "animal": "Dog" }.
Playground links:
Environment
- OS: macOS 26.5.2
- Node: 25.2.1
- npm: 11.6.2
Anything else?
No response
Prerequisites
What theme are you using?
core
Version
6.x
Current Behavior
When a property is defined as
allOf: [{ "$ref": "..." }]instead of a direct$ref,the
defaultdeclared in the referenced subschema is not populated intoformData,even with
experimental_defaultFormStateBehavior.allOf: "populateDefaults"enabled.On top of that, the select widget visually displays
Cat- the first enum option -while
formDatais{}. So the UI shows a selection the form data does not contain.Expected Behavior
allOf: [{ $ref }]and a bare$refare semantically equivalent for a single-elementallOf, so both should produceformData = { "animal": "Dog" }.present in
formData. When the value isundefinedit should render an empty /placeholder selection rather than silently falling back to the first enum entry.
Steps To Reproduce
Schema that works -
formDatabecomes{ "animal": "Dog" }:{ "type": "object", "properties": { "animal": { "title": "Animal", "$ref": "#/definitions/Animal" } }, "required": ["animal"], "definitions": { "Animal": { "type": "string", "enum": ["Cat", "Dog", "Bird"], "default": "Dog" } } }Same schema with the
$refwrapped inallOf-formDatastays{}:{ "type": "object", "properties": { "animal": { "title": "Animal", "allOf": [{ "$ref": "#/definitions/Animal" }] } }, "required": ["animal"], "definitions": { "Animal": { "type": "string", "enum": ["Cat", "Dog", "Bird"], "default": "Dog" } } }formData).experimental_defaultFormStateBehavior.allOftopopulateDefaults.CatwhileformDataremains{}, whereas the$refvariant showsDogand yields{ "animal": "Dog" }.Playground links:
Environment
Anything else?
No response