Skip to content

Commit

Permalink
clear search on single option select fix #99
Browse files Browse the repository at this point in the history
  • Loading branch information
adamberecz committed Aug 9, 2021
1 parent f02ab58 commit d5317c2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/composables/useMultiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default function useMultiselect (props, context, dep)
const input = dep.input
const open = dep.open
const close = dep.close
const clearSearch = dep.clearSearch

// ================ DATA ================

Expand Down Expand Up @@ -48,10 +49,15 @@ export default function useMultiselect (props, context, dep)
open()
}

const deactivate = () => {
const deactivate = async () => {
isActive.value = false

close()
setTimeout(() => {
if (!isActive.value) {
close()
clearSearch()
}
}, 1)
}

const handleCaretClick = () => {
Expand Down

0 comments on commit d5317c2

Please sign in to comment.