1
- import { ref , toRefs , computed , watch } from 'composition-api'
1
+ import { ref , toRefs , computed , watch , nextTick } from 'composition-api'
2
2
import normalize from './../utils/normalize'
3
3
import isObject from './../utils/isObject'
4
4
import isNullish from './../utils/isNullish'
@@ -10,7 +10,7 @@ export default function useOptions (props, context, dep)
10
10
options, mode, trackBy, limit, hideSelected, createTag, label,
11
11
appendNewTag, multipleLabel, object, loading, delay, resolveOnLoad,
12
12
minChars, filterResults, clearOnSearch, clearOnSelect, valueProp,
13
- canDeselect, max, strict,
13
+ canDeselect, max, strict, closeOnSelect ,
14
14
} = toRefs ( props )
15
15
16
16
// ============ DEPENDENCIES ============
@@ -22,6 +22,7 @@ export default function useOptions (props, context, dep)
22
22
const update = dep . update
23
23
const pointer = dep . pointer
24
24
const blur = dep . blur
25
+ const deactivate = dep . deactivate
25
26
26
27
// ================ DATA ================
27
28
@@ -244,7 +245,6 @@ export default function useOptions (props, context, dep)
244
245
245
246
blur ( )
246
247
select ( option )
247
- clearSearch ( )
248
248
break
249
249
250
250
case 'multiple' :
@@ -291,6 +291,10 @@ export default function useOptions (props, context, dep)
291
291
select ( option )
292
292
break
293
293
}
294
+
295
+ if ( closeOnSelect . value ) {
296
+ deactivate ( )
297
+ }
294
298
}
295
299
296
300
const getOption = ( val ) => {
0 commit comments