From 616293308cc2f1c6bb5d1a67fb75dc448ae6ceab Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Mon, 22 Mar 2021 10:30:14 +0100 Subject: [PATCH] fix(ui): units in selects and selects always sending 0 (#925) --- src/components/ValueId.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ValueId.vue b/src/components/ValueId.vue index 88524ff91b1..d01c85e2c06 100644 --- a/src/components/ValueId.vue +++ b/src/components/ValueId.vue @@ -119,6 +119,7 @@ :return-object="false" :item-text="itemText" item-value="value" + :suffix="value.unit" :append-outer-icon="!disable_send ? 'send' : null" v-model="value.newValue" @click:append-outer="updateValue(value)" @@ -143,6 +144,7 @@ :hint="help" persistent-hint chips + :suffix="value.unit" :item-text="itemText" item-value="value" :type="value.type === 'number' ? 'number' : 'text'" @@ -328,7 +330,10 @@ export default { updateValue (v, customValue) { // needed for on/off control to update the newValue - if (this.$refs.myCombo) { + if ( + this.$refs.myCombo && + this.$refs.myCombo.$refs.input._value !== null + ) { // trick used to send the value in combobox without the need to press enter this.value.newValue = this.$refs.myCombo.$refs.input._value }