fix bugs in make journal page.

This commit is contained in:
Ahmed Bouhuolia
2020-04-07 17:52:52 +02:00
parent aed7df7931
commit 05cc76b4f1
5 changed files with 17 additions and 7 deletions

View File

@@ -14,8 +14,13 @@ const MoneyFieldCellRenderer = ({
setValue(value);
}, []);
function isNumeric(data) {
return !isNaN(parseFloat(data)) && isFinite(data) && data.constructor !== Array;
}
const onBlur = () => {
payload.updateData(index, id, parseFloat(value));
const updateValue = isNumeric(value) ? parseFloat(value) : value;
payload.updateData(index, id, updateValue);
};
return (<MoneyInputGroup