From 117cf94172c9fe1254d73ab69cac9c44ecea019e Mon Sep 17 00:00:00 2001 From: Pierre Marchal Date: Fri, 3 Aug 2018 15:25:36 +0200 Subject: [PATCH] Parse number values from input number using parseFloat --- src/components/input.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/input.jsx b/src/components/input.jsx index 9d688fd..5c409e8 100644 --- a/src/components/input.jsx +++ b/src/components/input.jsx @@ -23,6 +23,8 @@ export const InputComponent = (props: Props ) => { if(props.type === 'file') { const file = event.target.files[0] props.dispatch(props.action(mapping, file)) + } else if (props.type === 'number') { + props.dispatch(props.action(mapping, parseFloat(event.target.value))) } else { props.dispatch(props.action(mapping, event.target.value)) }