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:
@@ -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}`}
|
||||
|
||||
Reference in New Issue
Block a user