[UI] Adjust form properties (#11855)
- Remove certain properties from downstream components - Reduces unnecessary console errors
This commit is contained in:
parent
12c060c7d1
commit
79521f974f
|
|
@ -410,6 +410,7 @@ export function RelatedModelField({
|
|||
const fieldDefinition = useMemo(() => {
|
||||
return {
|
||||
...definition,
|
||||
addCreateFields: undefined,
|
||||
autoFill: undefined,
|
||||
modelRenderer: undefined,
|
||||
onValueChange: undefined,
|
||||
|
|
|
|||
|
|
@ -45,9 +45,19 @@ export default function TextField({
|
|||
setTextValue(value || '');
|
||||
}, [value]);
|
||||
|
||||
/* Construct a "cut-down" version of the definition,
|
||||
* which does not include any attributes that the lower components do not recognize
|
||||
*/
|
||||
const fieldDefinition = useMemo(() => {
|
||||
return {
|
||||
...definition,
|
||||
allow_blank: undefined
|
||||
};
|
||||
}, [definition]);
|
||||
|
||||
return (
|
||||
<TextInput
|
||||
{...definition}
|
||||
{...fieldDefinition}
|
||||
ref={field.ref}
|
||||
id={fieldId}
|
||||
aria-label={`text-field-${field.name}`}
|
||||
|
|
|
|||
Loading…
Reference in New Issue