mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-04-22 19:02:15 +00:00
Updated DefaultInput
This commit is contained in:
parent
a61c8c4fe2
commit
0d743b30a3
@ -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!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user