fix: prevent numeric input from resetting to zero on blur without edit (#7560)

When a numeric input field was focused but not edited, the blur handler
called toNumber(null) which returned 0 via parseFloat(null) → NaN → 0.
Now we skip emitting the update when numericTemp is null (no edits made).
This commit is contained in:
XiaoYang
2026-04-16 08:48:13 +08:00
committed by GitHub
parent 7c39abc6b5
commit 34cf4014e6

View File

@@ -161,7 +161,7 @@
<v-text-field
:model-value="numericTemp ?? modelValue"
@update:model-value="val => (numericTemp = val)"
@blur="() => { emitUpdate(toNumber(numericTemp)); numericTemp = null }"
@blur="() => { if (numericTemp != null) { emitUpdate(toNumber(numericTemp)) } numericTemp = null }"
density="compact"
variant="outlined"
class="config-field"