Skip to content

Commit

Permalink
fix(sections): add unique key (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenjennings authored Apr 3, 2020
1 parent 1c041aa commit e616d70
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Autosuggest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<component
:is="cs.type"
v-for="(cs, key) in computedSections"
:ref="getSectionRef(key)"
:key="getSectionRef(key)"
:ref="getSectionRef(`${cs.name}${key}`)"
:key="getSectionRef(`${cs.name}${key}`)"
:current-index="currentIndex"
:normalize-item-function="normalizeItem"
:render-suggestion="renderSuggestion"
Expand Down Expand Up @@ -409,7 +409,8 @@ export default {
index <= this.computedSections[i].end_index
) {
let trueIndex = index - this.computedSections[i].start_index;
let childSection = this.$refs[this.getSectionRef(i)][0];
const sectionName = this.computedSections[i].name
let childSection = this.$refs[this.getSectionRef(`${sectionName}${i}`)][0];
if (childSection) {
obj = this.normalizeItem(
this.computedSections[i].name,
Expand Down

0 comments on commit e616d70

Please sign in to comment.