Skip to content

Commit

Permalink
fix error that can occur when hoverIndex is out of bounds (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
tskimmett authored Nov 16, 2021
1 parent feafe30 commit 4f525a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/select/src/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
aria-haspopup="listbox"
:aria-owns="id ? `${id}-listbox` : null"
:aria-expanded="visible ? 'true' : 'false'"
:aria-activedescendant="id && hoverIndex > -1 ? `${id}-option-${options[hoverIndex].value}` : null"
:aria-activedescendant="id && hoveredOption ? `${id}-option-${hoveredOption.value}` : null"
:size="selectSize"
:disabled="selectDisabled"
:readonly="readonly"
Expand Down Expand Up @@ -254,6 +254,10 @@
return ['small', 'mini'].indexOf(this.selectSize) > -1
? 'mini'
: 'small';
},
hoveredOption() {
return this.options[this.hoverIndex];
}
},
Expand Down

0 comments on commit 4f525a3

Please sign in to comment.