Skip to content

Commit 90605bd

Browse files
authored
refactor toggleDropdown for IE11 support (sagalbot#838)
1 parent 7a93779 commit 90605bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/Select.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,17 +548,17 @@
548548
* @return {void}
549549
*/
550550
toggleDropdown (e) {
551+
const target = e.target;
551552
const toggleTargets = [
552553
this.$el,
553554
this.searchEl,
554555
this.$refs.toggle.$el,
555556
this.$refs.openIndicator.$el,
556-
...Array.from(this.$refs.openIndicator.$el.children),
557+
// the line below is a bit gross, but required to support IE11 without adding polyfills
558+
...Array.prototype.slice.call(this.$refs.openIndicator.$el.childNodes)
557559
];
558-
559-
const target = e.target;
560560
561-
if (toggleTargets.includes(target) || target.classList.contains('vs__selected')) {
561+
if (toggleTargets.indexOf(target) > -1 || target.classList.contains('vs__selected')) {
562562
if (this.open) {
563563
this.searchEl.blur(); // dropdown will close on blur
564564
} else {

0 commit comments

Comments
 (0)