File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/components/Multiselect Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ export default {
171171 ]"
172172 :options =" options"
173173 :limit =" maxOptions"
174- :close-on-select =" !multiple "
174+ :close-on-select =" willCloseOnSelect "
175175 :multiple =" multiple"
176176 :label =" label"
177177 :track-by =" trackBy"
@@ -254,6 +254,15 @@ export default {
254254 },
255255 },
256256
257+ /**
258+ * Close the Multiselect when selecting an item.
259+ * Will be overwritten by !multiple if undefined.
260+ */
261+ closeOnSelect: {
262+ type: Boolean ,
263+ default: undefined ,
264+ },
265+
257266 /**
258267 * Allow multiple select ?
259268 */
@@ -373,6 +382,15 @@ export default {
373382 this .$emit (' change' , value)
374383 },
375384 },
385+
386+ /**
387+ * If closeOnSelect is not manually set, set it to !multiple
388+ * @returns {boolean} closeOnSelect for vue-multiselect
389+ */
390+ willCloseOnSelect () {
391+ if (this .closeOnSelect === undefined ) return ! this .multiple
392+ return this .closeOnSelect
393+ },
376394 },
377395
378396 watch: {
You can’t perform that action at this time.
0 commit comments