Skip to content

Commit bcf6cfb

Browse files
committed
fix(InputNumber): Number was not updated correctly #53
1 parent f69e4a8 commit bcf6cfb

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

dev/pages/inputs/InputNumber.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const schema
44
= [
55
{
66
$formkit: 'primeInputNumber',
7-
name: 'myInputNumber',
7+
name: 'firstNumber',
88
label: 'Input Number',
99
value: 1234,
1010
validation: 'max:10000',
@@ -13,7 +13,16 @@ const schema
1313
},
1414
{
1515
$formkit: 'primeInputNumber',
16-
name: 'myInputNumber',
16+
name: 'secondNumber',
17+
label: 'Input Number',
18+
value: 999,
19+
validation: 'min:900',
20+
useGrouping: false,
21+
minFractionDigits: 0,
22+
},
23+
{
24+
$formkit: 'primeInputNumber',
25+
name: 'fixedNumber',
1726
label: 'Input Number',
1827
value: 1234,
1928
class: 'customClass',

src/components/PrimeInputNumber.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ const props = defineProps({
3333
},
3434
})
3535
36-
const { unstyled, isInvalid, handleInput } = useFormKitInput(props.context)
36+
const { unstyled, isInvalid } = useFormKitInput(props.context)
3737
3838
function handleBlur(e: InputNumberBlurEvent) {
3939
props.context?.handlers.blur(e.originalEvent)
4040
}
41+
42+
function handleInput(_: any) {
43+
props.context?.node.input(_.value)
44+
}
4145
</script>
4246

4347
<template>

0 commit comments

Comments
 (0)