Skip to content

Commit

Permalink
Merge pull request #627 from biigle/label-tree-selection-bug
Browse files Browse the repository at this point in the history
Fix highlighting for unchanged values in label tree
  • Loading branch information
mzur authored Aug 7, 2023
2 parents 6300a86 + 154ad3d commit 970a9c6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions resources/assets/js/core/components/typeahead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:placeholder="placeholder"
@focus="emitFocus"
@blur="emitBlur"
@keyup.enter="emitInternalValue"
>
<typeahead
v-model="internalValue"
Expand All @@ -19,6 +20,7 @@
>
<template slot="item" slot-scope="props">
<typeahead-item
@click.native="emitInternalValue"
v-for="(item, index) in props.items"
:key="index"
:props="props"
Expand Down Expand Up @@ -93,17 +95,17 @@ export default {
emitBlur(e) {
this.$emit('blur', e);
},
},
watch: {
internalValue(value) {
if (typeof value === 'object') {
this.$emit('input', value);
this.$emit('select', value);
emitInternalValue() {
if (typeof this.internalValue === 'object') {
this.$emit('input', this.internalValue);
this.$emit('select', this.internalValue);
if (this.clearOnSelect) {
this.clear();
}
}
},
},
watch: {
value(value) {
this.internalValue = value;
},
Expand Down

0 comments on commit 970a9c6

Please sign in to comment.