Skip to content

Commit

Permalink
refactor toggleDropdown for IE11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff committed Apr 17, 2019
1 parent 7a93779 commit 4865270
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -548,17 +548,17 @@
* @return {void}
*/
toggleDropdown (e) {
const target = e.target;
const toggleTargets = [
this.$el,
this.searchEl,
this.$refs.toggle.$el,
this.$refs.openIndicator.$el,
...Array.from(this.$refs.openIndicator.$el.children),
// the line below is a bit gross, but required to support IE11 without adding polyfills
...Array.prototype.slice.call(this.$refs.openIndicator.$el.childNodes)
];
const target = e.target;
if (toggleTargets.includes(target) || target.classList.contains('vs__selected')) {
if (toggleTargets.indexOf(target) > -1 || target.classList.contains('vs__selected')) {
if (this.open) {
this.searchEl.blur(); // dropdown will close on blur
} else {
Expand Down

0 comments on commit 4865270

Please sign in to comment.