Browse Source

Merge pull request #1712 from jhoobergs/master

Fix state of label selection on LabelingMenu for sequenceLabeling
pull/1713/head
Hiroki Nakayama 2 years ago
committed by GitHub
parent
commit
4176f40ed0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
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-list-item>
<v-autocomplete <v-autocomplete
ref="autocomplete" ref="autocomplete"
:value="selectedLabel"
v-model="value"
:items="labels" :items="labels"
autofocus autofocus
dense dense
@ -92,6 +92,7 @@ export default Vue.extend({
entity: null as any, entity: null as any,
fromEntity: null as any, fromEntity: null as any,
toEntity: 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. // Todo: a bit hacky. I want to fix this problem.
// https://github.com/vuetifyjs/vuetify/issues/10765 // https://github.com/vuetifyjs/vuetify/issues/10765
this.$nextTick(() => { this.$nextTick(() => {
this.value = null
if (this.$refs.autocomplete) { if (this.$refs.autocomplete) {
(this.$refs.autocomplete as any).selectedItems = [] (this.$refs.autocomplete as any).selectedItems = []
} }
@ -114,9 +116,10 @@ export default Vue.extend({
}, },
onLabelSelected(labelId: number) { onLabelSelected(labelId: number) {
this.value = labelId
this.$emit('click:label', labelId) this.$emit('click:label', labelId)
this.close() this.close()
} }
} }
}) })
</script>
</script>
Loading…
Cancel
Save