mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user