mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-04-22 19:02:15 +00:00
Updated SelectInput
This commit is contained in:
parent
d55730bedd
commit
78e572faf3
@ -9,12 +9,14 @@ import { realType } from '../Functions';
|
|||||||
*/
|
*/
|
||||||
export default class SelectInput extends DefaultInput {
|
export default class SelectInput extends DefaultInput {
|
||||||
|
|
||||||
public formatValue(val: any): any {
|
public formatValue(value: any): any {
|
||||||
const opt = this.element.querySelector(`option[value="${val}"]`) || this.element.querySelector("option[selected]")
|
if (typeof value === "undefined") {
|
||||||
if (opt) {
|
const opt: HTMLOptionElement = this.element.querySelector("option[selected]")
|
||||||
return realType(opt.getAttribute("value") || "")
|
if (opt) {
|
||||||
|
return opt.value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return undefined
|
return realType(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static identity: InputIdentity = {
|
public static identity: InputIdentity = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user