Skip to content

Commit

Permalink
fix(vue3): migrate refs array (#1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnuletik authored Jan 4, 2022
1 parent 38cefa7 commit 484a7b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>
<div ref="selectedOptions" class="vs__selected-options">
<slot
v-for="option in selectedValue"
v-for="(option, i) in selectedValue"
name="selected-option-container"
:option="normalizeOptionForSlot(option)"
:deselect="deselect"
Expand All @@ -34,6 +34,7 @@
<button
v-if="multiple"
ref="deselectButtons"
:ref="el => deselectButtons[i] = el"
:disabled="disabled"
type="button"
class="vs__deselect"
Expand Down Expand Up @@ -693,6 +694,7 @@ export default {
pushedTags: [],
// eslint-disable-next-line vue/no-reserved-keys
_value: [], // Internal value managed by Vue Select if no `value` prop is passed
deselectButtons: []
}
},
Expand Down Expand Up @@ -1101,7 +1103,7 @@ export default {
// don't react to click on deselect/clear buttons,
// they dropdown state will be set in their click handlers
const ignoredButtons = [
...(this.$refs['deselectButtons'] || []),
...(this.deselectButtons || []),
...([this.$refs['clearButton']] || []),
]
Expand Down

0 comments on commit 484a7b4

Please sign in to comment.