forked from vikunja/frontend
feat: allow selecting multiple labels at once
This commit is contained in:
parent
a47d106926
commit
ee68227065
|
@ -7,7 +7,9 @@
|
|||
@focus="focus"
|
||||
>
|
||||
<div class="control" :class="{'is-loading': loading || localLoading}">
|
||||
<div class="input-wrapper input" :class="{'has-multiple': multiple && Array.isArray(internalValue) && internalValue.length > 0}">
|
||||
<div
|
||||
class="input-wrapper input"
|
||||
:class="{'has-multiple': multiple && Array.isArray(internalValue) && internalValue.length > 0}">
|
||||
<template v-if="Array.isArray(internalValue)">
|
||||
<template v-for="(item, key) in internalValue">
|
||||
<slot name="tag" :item="item">
|
||||
|
@ -81,7 +83,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { i18n } from '@/i18n'
|
||||
import {i18n} from '@/i18n'
|
||||
import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside'
|
||||
|
||||
export default {
|
||||
|
@ -180,6 +182,12 @@ export default {
|
|||
return 200
|
||||
},
|
||||
},
|
||||
closeAfterSelect: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return true
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -285,7 +293,9 @@ export default {
|
|||
this.$emit('update:modelValue', this.internalValue)
|
||||
this.$emit('select', object)
|
||||
this.setSelectedObject(object)
|
||||
this.closeSearchResults()
|
||||
if (this.closeAfterSelect && this.filteredSearchResults.length > 0 && !this.creatableAvailable) {
|
||||
this.closeSearchResults()
|
||||
}
|
||||
},
|
||||
setSelectedObject(object, resetOnly = false) {
|
||||
this.internalValue = object
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
:create-placeholder="$t('task.label.createPlaceholder')"
|
||||
v-model="labels"
|
||||
:search-delay="10"
|
||||
:close-after-select="false"
|
||||
>
|
||||
<template #tag="props">
|
||||
<span
|
||||
|
|
Loading…
Reference in New Issue