From 332bf032c97da91713cfda71ad0463d527c861dd Mon Sep 17 00:00:00 2001 From: "Enjeck C." Date: Wed, 3 Dec 2025 07:10:55 +0000 Subject: [PATCH] fix: improve number input validation and update handling Signed-off-by: Enjeck C. --- .../partials/rowTypePartials/NumberForm.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/shared/components/ncTable/partials/rowTypePartials/NumberForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/NumberForm.vue index d76cf89c5c..fc2cad3827 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/NumberForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/NumberForm.vue @@ -12,7 +12,9 @@ :min="column.numberMin" :max="column.numberMax" :readonly="column.viewColumnInformation?.readonly" - :step="getStep"> + :step="getStep" + @blur="validateAndUpdate" + @keyup.enter="validateAndUpdate">
{{ column.numberSuffix }}
@@ -62,16 +64,13 @@ export default { } } }, - set(v) { this.$emit('update:value', this.parseValue(v)) }, + set(v) { + this.$emit('update:value', v === '' ? null : v) + }, }, }, watch: { - localValue() { - const value = this.parseValue(this.localValue) - this.localValue = value - this.$emit('update:value', value) - }, value() { this.localValue = this.value }, @@ -82,6 +81,11 @@ export default { }, methods: { + validateAndUpdate() { + const parsedValue = this.parseValue(this.localValue) + this.localValue = parsedValue + this.$emit('update:value', parsedValue) + }, parseValue(inputValue) { if (inputValue === null || inputValue === '') { return null