Skip to content
2 changes: 1 addition & 1 deletion dashboard/src/components/shared/ConfigItemRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<v-text-field
:model-value="numericTemp ?? modelValue"
@update:model-value="val => (numericTemp = val)"
@blur="() => { emitUpdate(toNumber(numericTemp)); numericTemp = null }"
@blur="() => { emitUpdate(numericTemp != null ? toNumber(numericTemp) : modelValue); numericTemp = null }"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this fix correctly prevents the value from being reset to 0 when numericTemp is null, emitting the modelValue back to the parent is redundant when no changes have been made (e.g., when the user just selects text and blurs). It's cleaner to only emit an update and reset the temporary state if the user has actually interacted with the input (i.e., numericTemp is not null). This avoids unnecessary event cycles and potential side-effects in the parent component.

        @blur="() => { if (numericTemp != null) { emitUpdate(toNumber(numericTemp)); numericTemp = null } }"

density="compact"
variant="outlined"
class="config-field"
Expand Down