Skip to content

Commit 9b35fbd

Browse files
fix: data label field initialization
1 parent 37758dc commit 9b35fbd

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

jdaviz/components/plugin_auto_label.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<v-form ref="form" style="width: 100%">
44
<v-text-field
55
ref="textField"
6-
:value="displayValue"
7-
@keyup="if(auto) {if ($event.srcElement._value === displayValue) {return}; $emit('update:auto', false)}; $emit('update:value', $event.srcElement._value)"
6+
:model-value="displayValue"
7+
@update:modelValue="updateValue"
88
@mouseenter="showIcon = true"
99
@mouseleave="showIcon = false"
1010
:label="api_hints_enabled && api_hint ? api_hint : label"
@@ -49,6 +49,17 @@ export default {
4949
invalid_msg() {
5050
this.$refs.form.validate();
5151
}
52+
},
53+
methods: {
54+
updateValue(value) {
55+
if(this.$props.auto && value === this.displayValue) {
56+
return;
57+
}
58+
if(this.$props.auto) {
59+
this.$emit('update:auto', false);
60+
}
61+
this.$emit('update:value', value);
62+
}
5263
}
5364
};
5465
</script>

0 commit comments

Comments
 (0)