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:
@@ -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.indexOf(target) > -1 || target.classList.contains('vs__selected')) {
|
||||||
|
|
||||||
if (toggleTargets.includes(target) || 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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user