Skip to content

Commit 4ac8900

Browse files
committed
fix: on blur close menu
1 parent 51175ac commit 4ac8900

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Select.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ const openMenu = (options?: { focusInput?: boolean }) => {
138138
}
139139
};
140140
141+
const closeMenu = () => {
142+
menuOpen.value = false;
143+
search.value = "";
144+
};
145+
141146
const focusInput = () => {
142147
if (input.value) {
143148
input.value.focus();
@@ -295,6 +300,7 @@ onBeforeUnmount(() => {
295300
:disabled="isDisabled"
296301
:placeholder="selectedOptions.length === 0 ? placeholder : ''"
297302
@focus="openMenu({ focusInput: false })"
303+
@keydown.tab="closeMenu"
298304
>
299305
</div>
300306

0 commit comments

Comments
 (0)