mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
fix: Disable item type inventory in edit mode
This commit is contained in:
@@ -31,7 +31,7 @@ export default function ItemFormPrimarySection() {
|
|||||||
const nameFieldRef = useRef(null);
|
const nameFieldRef = useRef(null);
|
||||||
|
|
||||||
// Formik context.
|
// Formik context.
|
||||||
const { values: { itemType } } = useFormikContext();
|
const { values: { type } } = useFormikContext();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Auto focus item name field once component mount.
|
// Auto focus item name field once component mount.
|
||||||
@@ -87,7 +87,7 @@ export default function ItemFormPrimarySection() {
|
|||||||
form.setFieldValue('type', _value);
|
form.setFieldValue('type', _value);
|
||||||
})}
|
})}
|
||||||
selectedValue={value}
|
selectedValue={value}
|
||||||
disabled={itemType === 'inventory'}
|
disabled={type === 'inventory'}
|
||||||
>
|
>
|
||||||
<Radio label={<T id={'service'} />} value="service" />
|
<Radio label={<T id={'service'} />} value="service" />
|
||||||
<Radio label={<T id={'non_inventory'} />} value="non-inventory" />
|
<Radio label={<T id={'non_inventory'} />} value="non-inventory" />
|
||||||
|
|||||||
Reference in New Issue
Block a user