Force number field to set numerical values only
This commit is contained in:
parent
44cfd430c6
commit
181143935e
|
@ -11,7 +11,12 @@
|
||||||
let fieldApi
|
let fieldApi
|
||||||
|
|
||||||
const onBlur = event => {
|
const onBlur = event => {
|
||||||
fieldApi.setValue(event.target.value)
|
let value = event.target.value
|
||||||
|
if (type === "number") {
|
||||||
|
const float = parseFloat(value)
|
||||||
|
value = isNaN(float) ? null : float
|
||||||
|
}
|
||||||
|
fieldApi.setValue(value)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue