Commit 8f5158f2 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_json_form: react jsonschema form gadget use typeof to be compatible with firefox 68

parent e250eba1
......@@ -28,7 +28,7 @@ function makeUiSchema(schema, uiSchema, visited) {
for (const [key, value] of Object.entries(schema.properties)) {
uiSchema[key] = {};
if (value.default && !(value.default instanceof Object)) {
if (value?.type === 'string' && value.const === undefined) {
if (typeof(value) === 'string' && value.const === undefined) {
uiSchema[key]['ui:placeholder'] = value.default;
}
if (value.const === undefined) {
......@@ -43,7 +43,7 @@ function makeUiSchema(schema, uiSchema, visited) {
if (value.textarea) {
uiSchema[key]["ui:widget"] = "textarea"
}
if (value?.type === 'object') {
if (typeof(value) === 'object') {
makeUiSchema(value, uiSchema[key], visited);
}
for (const oneOf of value.oneOf || []) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment