Skip to content

Commit 79882ed

Browse files
author
Jeff
committed
ensure open-indicator can open the dropdown
1 parent 9c2cafe commit 79882ed

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/components/Select.vue

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,24 @@
547547
* @param {Event} e
548548
* @return {void}
549549
*/
550-
toggleDropdown(e) {
551-
if (e.target === this.$refs.openIndicator || e.target === this.searchEl || e.target === this.$refs.toggle ||
552-
e.target.classList.contains('vs__selected') || e.target === this.$el) {
550+
toggleDropdown (e) {
551+
const toggleTargets = [
552+
this.$el,
553+
this.searchEl,
554+
this.$refs.toggle.$el,
555+
this.$refs.openIndicator.$el,
556+
...Array.from(this.$refs.openIndicator.$el.children),
557+
];
558+
559+
const target = e.target;
560+
561+
if (toggleTargets.includes(target) || target.classList.contains('vs__selected')) {
553562
if (this.open) {
554-
this.searchEl.blur() // dropdown will close on blur
563+
this.searchEl.blur(); // dropdown will close on blur
555564
} else {
556565
if (!this.disabled) {
557-
this.open = true
558-
this.searchEl.focus()
566+
this.open = true;
567+
this.searchEl.focus();
559568
}
560569
}
561570
}

0 commit comments

Comments
 (0)