Skip to content

Commit

Permalink
fix(vue-select): don't focus input after outside click
Browse files Browse the repository at this point in the history
  • Loading branch information
devCrossNet committed Apr 8, 2022
1 parent 6556690 commit 7628434
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/input-and-actions/VueSelect/VueSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ export default defineComponent({
menuRef.value.focus(displayItem.value);
};
const close = () => {
selectRef.value.querySelector(`#custom-${props.id}`).focus();
const close = (focusInput = true) => {
if (focusInput) {
selectRef.value.querySelector(`#custom-${props.id}`).focus();
}
show.value = false;
};
Expand Down Expand Up @@ -252,7 +254,7 @@ export default defineComponent({
}
};
useOutsideClick(selectRef, () => close());
useOutsideClick(selectRef, () => close(false));
return {
validator,
Expand Down

0 comments on commit 7628434

Please sign in to comment.