aboutsummaryrefslogtreecommitdiff
path: root/input/number.ts
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-09-19 00:46:28 +0700
committerShulhan <ms@kilabit.info>2021-09-19 00:47:00 +0700
commit2f5f4d9bb21336f97e56b2437b4d73562cd65d61 (patch)
tree0bb0a2f7e8fdce88936b5d62846219d898b84e94 /input/number.ts
parent779867def15468b542f5f3dc20b991fcfb241a19 (diff)
downloadpakakeh.ts-2f5f4d9bb21336f97e56b2437b4d73562cd65d61.tar.xz
input: allow floating value on WuiInputNumber
While at it, set the input number "step" option to "any".
Diffstat (limited to 'input/number.ts')
-rw-r--r--input/number.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/input/number.ts b/input/number.ts
index 9a2c514..4f37eb7 100644
--- a/input/number.ts
+++ b/input/number.ts
@@ -101,6 +101,7 @@ export class WuiInputNumber {
}
this.el_input.type = "number"
+ this.el_input.step = "any"
this.el_input.value = "" + this.opts.value
let hint = ""
@@ -174,7 +175,7 @@ export class WuiInputNumber {
let target = ev.target as HTMLInputElement
ev.preventDefault()
- let newValue = parseInt(target.value)
+ let newValue = +target.value
if (newValue === null) {
this.el_input.style.backgroundColor = "lightsalmon"
return false