mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
8a5871e606
Prior to this commit, it wasn't possible to enter decimal numbers with dots. The reason for that is that all units are recalculated on form control change and values like `2.` are simply converted to `2`. As every change will cause a `setState()` in Cockpit, users never had a chance to get "beyond" the first dot of their input value. This is now fixed by preventing the recalculation all together when the last character in the entered value is a `.` In that case, we simply update the form control using `setState()` and don't touch all the other values. The next key stroke will cause a full recalculation again.