diff --git a/src/components/modifyQuantity/ModifyQuantity.tsx b/src/components/modifyQuantity/ModifyQuantity.tsx index dd2b250b..85edc7ce 100644 --- a/src/components/modifyQuantity/ModifyQuantity.tsx +++ b/src/components/modifyQuantity/ModifyQuantity.tsx @@ -63,6 +63,13 @@ export const ModifyQuantity = ({ justifyContent: 'center', }, }); + + const onEndEditing = (value: string | undefined) => { + if (value) { + onValueChange(Number(value)); + } + }; + return ( @@ -76,15 +83,10 @@ export const ModifyQuantity = ({ {text} ); diff --git a/src/components/numberSelector/NumberSelector.tsx b/src/components/numberSelector/NumberSelector.tsx index 962bf7da..e1d633c8 100644 --- a/src/components/numberSelector/NumberSelector.tsx +++ b/src/components/numberSelector/NumberSelector.tsx @@ -9,7 +9,6 @@ export interface Props { validator: NumberValidator; initialValue: number | undefined; value: number | undefined; - onValueChange?: (value: number) => void; onEndEditing: (value: string | undefined) => void; style?: ViewStyle; minusIcon?: IconName; @@ -25,6 +24,7 @@ export interface Props { export const RoundValue = (val: number): number => { return Math.round(val * 10) / 10; }; + export const ComputeCrementedValue = ( value: number, step: number,