Improvements to units: move the unit handling into the validated text field, fix 'isValid' and typing of partial denominations

This commit is contained in:
Pieter Vander Vennet 2021-06-25 20:38:12 +02:00
parent 89c5c78f41
commit 37dab7a9a2
3 changed files with 43 additions and 35 deletions

View file

@ -65,8 +65,8 @@ export class TextField extends InputElement<string> {
this.value.addCallbackAndRun(value => {
if (!(value !== undefined && value !== null)) {
field["value"] = "";
if (value === undefined || value === null) {
// We leave the textfield as is - make sure we do not erase it!
return;
}
field["value"] = value;