forked from MapComplete/MapComplete
Use addCallbackAndRunD where applicable, which deletes many if(value==undefined) checks
This commit is contained in:
parent
d7e421efc9
commit
6576ac36cc
5 changed files with 6 additions and 18 deletions
|
@ -64,11 +64,8 @@ export class TextField extends InputElement<string> {
|
|||
const field = inputEl;
|
||||
|
||||
|
||||
this.value.addCallbackAndRun(value => {
|
||||
if (value === undefined || value === null) {
|
||||
// We leave the textfield as is - make sure we do not erase it!
|
||||
return;
|
||||
}
|
||||
this.value.addCallbackAndRunD(value => {
|
||||
// We leave the textfield as is in the case of undefined or null (handled by addCallbackAndRunD) - make sure we do not erase it!
|
||||
field["value"] = value;
|
||||
if (self.IsValid(value)) {
|
||||
self.RemoveClass("invalid")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue