admin/files: avoid console warning
Massimo Melina committed
Jun 10, 2023 at 19:43 UTC
357ee6ebdb56257193ef1387197242abf8b5f994
2 files changed
+4
-1
admin/src/FileForm.ts
+2
-1
@@ -143,7 +143,8 @@ export default function FileForm({ file, anyMask, defaultPerms, addToBar, urls }
143
isDir && { k: 'masks', multiline: true, lg: true,
144
toField: yaml.stringify, fromField: v => v ? yaml.parse(v) : undefined,
145
sx: { '& textarea': { fontFamily: 'monospace' } },
146
- helperText: ["Special field, leave empty unless you know what you are doing. YAML syntax. ", wikiLink('Permissions', "(examples)")] }
146
+ helperText: ["Special field, leave empty unless you know what you are doing. YAML syntax. ", wikiLink('Permissions', "(examples)")]
147
+ }
148
]
149
})
150
mui-grid-form/index.ts
+2
@@ -162,6 +162,8 @@ export function Form<Values extends Dict>({
162
}
163
},
164
} as Partial<FieldProps<any>>)
165
+ if (Array.isArray(field.helperText))
166
+ field.helperText = h(Fragment, {}, ...field.helperText)
167
if (errMsg) // special rendering when we have both error and helperText. "hr" would be nice but issues a warning because contained in a <p>
168
field.helperText = !field.helperText ? errMsg
169
: h(Fragment, {},