Browse Source

Fix state of label selection on LabelingMenu for sequenceLabeling

Currently labeling two enties with the same label by chosing it from the
autocomplete, didn't work. Labeling the first entity worked, but when you
tried to label a new entity with the same label chosen from the
autocomplete, nothing happened.
pull/1712/head
Jesse Hoobergs 2 years ago
parent
commit
022d707cb8
1 changed files with 5 additions and 2 deletions
  1. 7
      frontend/components/tasks/sequenceLabeling/LabelingMenu.vue

7
frontend/components/tasks/sequenceLabeling/LabelingMenu.vue

@ -16,7 +16,7 @@
<v-list-item>
<v-autocomplete
ref="autocomplete"
:value="selectedLabel"
v-model="value"
:items="labels"
autofocus
dense
@ -92,6 +92,7 @@ export default Vue.extend({
entity: null as any,
fromEntity: null as any,
toEntity: null as any,
value: this.selectedLabel
};
},
@ -106,6 +107,7 @@ export default Vue.extend({
// Todo: a bit hacky. I want to fix this problem.
// https://github.com/vuetifyjs/vuetify/issues/10765
this.$nextTick(() => {
this.value = undefined;
if (this.$refs.autocomplete) {
(this.$refs.autocomplete as any).selectedItems = []
}
@ -114,9 +116,10 @@ export default Vue.extend({
},
onLabelSelected(labelId: number) {
this.value= labelId;
this.$emit('click:label', labelId)
this.close()
}
}
})
</script>
</script>
Loading…
Cancel
Save