Skip to content

Commit

Permalink
fix lusaxweb#770 vsSelect open/close at the same time
Browse files Browse the repository at this point in the history
it's adopted from @okrulik 's comment in lusaxweb#770.
it should be considered a workaround, not a proper fix.

somehow, `clickBlur` method would randomly capture click event from \<body\>, closest method would always return null, make vsSelect open/close at the same time.
  • Loading branch information
miaulightouch authored Jun 16, 2020
1 parent b11b763 commit 8b00b4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/vsSelect/vsSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ export default {
});
},
clickBlur(event) {
let closestx = event.target.closest(".vs-select--options");
let closestx = event.target == document.body
? event.target.getElementsByClassName("vs-select--options").item(0)
: event.target.closest(".vs-select--options");
if (!closestx) {
this.closeOptions();
Expand Down

0 comments on commit 8b00b4f

Please sign in to comment.