mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
refactor toggleDropdown for IE11 support (#838)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user