2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-06 09:43:38 +00:00

[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
2 changed files with 12 additions and 1 deletions
@@ -410,6 +410,7 @@ export function RelatedModelField({
const fieldDefinition = useMemo(() => { const fieldDefinition = useMemo(() => {
return { return {
...definition, ...definition,
addCreateFields: undefined,
autoFill: undefined, autoFill: undefined,
modelRenderer: undefined, modelRenderer: undefined,
onValueChange: undefined, onValueChange: undefined,
@@ -45,9 +45,19 @@ export default function TextField({
setTextValue(value || ''); setTextValue(value || '');
}, [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 ( return (
<TextInput <TextInput
{...definition} {...fieldDefinition}
ref={field.ref} ref={field.ref}
id={fieldId} id={fieldId}
aria-label={`text-field-${field.name}`} aria-label={`text-field-${field.name}`}