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(() => {
|
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}`}
|
||||||
|
|||||||
Reference in New Issue
Block a user