Skip to content

Commit 8a5f2e9

Browse files
committed
feat: enhance decimal input handling with improved value parsing and input attributes
1 parent 26d0619 commit 8a5f2e9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

adminforth/spa/src/components/ColumnValueInput.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,21 @@
9191
/>
9292
<Input
9393
v-else-if="(type || column.type) === 'decimal'"
94+
ref="input"
9495
type="number"
96+
inputmode="decimal"
9597
step="any"
9698
class="w-40"
9799
placeholder="0.0"
98100
:fullWidth="true"
99101
:prefix="column.inputPrefix"
100102
:suffix="column.inputSuffix"
101-
:modelValue="String(value)"
102-
@update:modelValue="(val: any) => $emit('update:modelValue', val)"
103+
:readonly="(column.editReadonly && source === 'edit') || readonly"
104+
105+
:modelValue="value !== null && value !== undefined ? parseFloat(value) : ''"
106+
107+
@update:modelValue="$emit('update:modelValue', $event)"
108+
103109
@blur="$emit('update:modelValue', value ? parseFloat(value).toString() : '')"
104110
/>
105111
<Input

0 commit comments

Comments
 (0)