diff --git a/src/lib/core/components/Form/hooks/useField.tsx b/src/lib/core/components/Form/hooks/useField.tsx index 28d25d93..0984a1e5 100644 --- a/src/lib/core/components/Form/hooks/useField.tsx +++ b/src/lib/core/components/Form/hooks/useField.tsx @@ -101,7 +101,7 @@ export const useField = ({ const error = validate?.(_value); let value = transformArrIn(_value); - if (isNumberSpec(spec) && value && !error) { + if (isNumberSpec(spec) && value && value !== REMOVED_ITEM && !error) { value = Number(value) as Value; } diff --git a/src/lib/kit/components/Views/ArrayBaseView.tsx b/src/lib/kit/components/Views/ArrayBaseView.tsx index ec3ced31..9353463a 100644 --- a/src/lib/kit/components/Views/ArrayBaseView.tsx +++ b/src/lib/kit/components/Views/ArrayBaseView.tsx @@ -1,5 +1,7 @@ import React from 'react'; +import _ from 'lodash'; + import {ArrayView, Spec, ViewController, isCorrectSpec} from '../../../core'; export const ArrayBaseView: ArrayView = ({spec, name, value = []}) => { @@ -27,7 +29,7 @@ export const ArrayBaseView: ArrayView = ({spec, name, value = []}) => { const items = React.useMemo( () => - value.map((__, idx) => { + _.map(value, (__, idx) => { const itemSpec = getItemSpec(idx); if (!itemSpec) {