mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-18 16:46:38 +00:00
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.