File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 547
547
* @param {Event} e
548
548
* @return {void}
549
549
*/
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' )) {
553
562
if (this .open ) {
554
- this .searchEl .blur () // dropdown will close on blur
563
+ this .searchEl .blur (); // dropdown will close on blur
555
564
} else {
556
565
if (! this .disabled ) {
557
- this .open = true
558
- this .searchEl .focus ()
566
+ this .open = true ;
567
+ this .searchEl .focus ();
559
568
}
560
569
}
561
570
}
You can’t perform that action at this time.
0 commit comments