Updated DefaultInput

This commit is contained in:
Florian Bouillon 2019-11-15 11:12:40 +01:00
parent a61c8c4fe2
commit 0d743b30a3
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -13,6 +13,7 @@ export default class DefaultInput extends InputAbstract {
} }
public formatValue(value: any): any { public formatValue(value: any): any {
if (typeof value === "undefined") return ""
// if the value is a number return it as a number obj // if the value is a number return it as a number obj
return realType(value) return realType(value)
} }
@ -22,6 +23,7 @@ export default class DefaultInput extends InputAbstract {
// (Allow other inputs to play with inputs) // (Allow other inputs to play with inputs)
let attr = this.element.getAttribute("name") || this.element.dataset.name; let attr = this.element.getAttribute("name") || this.element.dataset.name;
if (attr) return attr if (attr) return attr
console.error(this.element)
throw Error("Error: could not get input name!") throw Error("Error: could not get input name!")
} }