[UI] Adjust form properties (#11855)

- Remove certain properties from downstream components
- Reduces unnecessary console errors
This commit is contained in:
Oliver 2026-05-03 19:37:23 +10:00 committed by GitHub
parent 12c060c7d1
commit 79521f974f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -410,6 +410,7 @@ export function RelatedModelField({
const fieldDefinition = useMemo(() => {
return {
...definition,
addCreateFields: undefined,
autoFill: undefined,
modelRenderer: undefined,
onValueChange: undefined,

View File

@ -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}`}