2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

refactor toggleDropdown for IE11 support (#838)

This commit is contained in:
Jeff Sagal
2019-04-17 10:15:19 -05:00
committed by GitHub
parent 7a93779ddf
commit 90605bd1c5
+4 -4
View File
@@ -548,17 +548,17 @@
* @return {void} * @return {void}
*/ */
toggleDropdown (e) { toggleDropdown (e) {
const target = e.target;
const toggleTargets = [ const toggleTargets = [
this.$el, this.$el,
this.searchEl, this.searchEl,
this.$refs.toggle.$el, this.$refs.toggle.$el,
this.$refs.openIndicator.$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) { if (this.open) {
this.searchEl.blur(); // dropdown will close on blur this.searchEl.blur(); // dropdown will close on blur
} else { } else {