Specific invalid type breaks Form instead of rendering UnsupportedFieldTemplate
#3875
Closed
4 tasks done
Labels
Prerequisites
What theme are you using?
core
Version
5.x
Current Behavior
There is a bug where Form won't render the
UnsupportedFieldTemplate
and instead break the app if the schema type is an array with the first element being a string or a number e.g.:{ type: "unsupported type" }
-> renders theUnsupportedFieldTemplate
{ type: ["unsupported type", "string"] }
-> renders theUnsupportedFieldTemplate
{ type: ["string", "unsupported type"] }
-> breaks the form{ type: ["number", "unsupported type"] }
-> breaks the formLive examples of this below:
Unsupported schema type works
Unsupported schema type does not work
Expected Behavior
When the schema type is unsupported in any way it should render the
UnsupportedFieldTemplate
and not break the Form.This should include e.g.:
{ type: ["string", "unsupported type"] }
{ type: ["number", "unsupported type"] }
Steps To Reproduce
Create a form with the following schema
e.g.:
Observe that
UnsupportedFieldTemplate
does not render and the app/Form throws an exception.Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: