From 1758aebb731ce9dfd5341e5765ea734570a0b12d Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 2 Dec 2023 21:13:14 +0100 Subject: [PATCH] choice input datatype detection --- vue/src/components/Modals/ChoiceInput.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vue/src/components/Modals/ChoiceInput.vue b/vue/src/components/Modals/ChoiceInput.vue index 73f9fa85..5c1a24cb 100644 --- a/vue/src/components/Modals/ChoiceInput.vue +++ b/vue/src/components/Modals/ChoiceInput.vue @@ -25,6 +25,12 @@ export default { }, mounted() { this.new_value = this.value + + if (this.new_value === "") { // if the selection is empty but the options are of type number, set to 0 instead of "" + if (typeof this.options[0]['value'] === 'number') { + this.new_value = 0 + } + } }, watch: { new_value: function () {