@@ -87,7 +87,7 @@ import { emit } from '@nextcloud/event-bus'
import { generateOcsUrl } from '@nextcloud/router'
import axios from '@nextcloud/axios'
import NcActionCheckbox from '@nextcloud/vue/dist/Components/NcActionCheckbox.js'
-import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js'
+import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import AnswerInput from './AnswerInput.vue'
import QuestionMixin from '../../mixins/QuestionMixin.js'
@@ -100,7 +100,7 @@ export default {
components: {
AnswerInput,
NcActionCheckbox,
- NcMultiselect,
+ NcSelect,
},
mixins: [QuestionMixin],
@@ -173,15 +173,14 @@ export default {
},
methods: {
- onSelect(option) {
- // Simple select
- if (!this.isMultiple) {
- this.$emit('update:values', [option.id])
+ onInput(option) {
+ if (Array.isArray(option)) {
+ this.$emit('update:values', [...new Set(option.map((opt) => opt.id))])
return
}
- // Emit values and remove duplicates
- this.$emit('update:values', [...new Set(option.id)])
+ // Simple select
+ this.$emit('update:values', option ? [option.id] : [])
},
/**
diff --git a/src/components/SidebarTabs/SharingSearchDiv.vue b/src/components/SidebarTabs/SharingSearchDiv.vue
index 37d83f501..d4a2d9151 100644
--- a/src/components/SidebarTabs/SharingSearchDiv.vue
+++ b/src/components/SidebarTabs/SharingSearchDiv.vue
@@ -23,27 +23,20 @@
-
-
- {{ t('forms', 'No recommendations. Start typing.') }}
-
-
+ @search="asyncSearch"
+ @input="addShare">
+
{{ noResultText }}
-
+
@@ -51,7 +44,7 @@
import { generateOcsUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'
import axios from '@nextcloud/axios'
-import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js'
+import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import debounce from 'debounce'
import OcsResponse2Data from '../../utils/OcsResponse2Data.js'
@@ -60,7 +53,7 @@ import logger from '../../utils/Logger.js'
export default {
components: {
- NcMultiselect,
+ NcSelect,
},
mixins: [ShareTypes],
@@ -122,8 +115,8 @@ export default {
* @return {string}
*/
noResultText() {
- if (this.loading) {
- return t('forms', 'Searching …')
+ if (!this.query) {
+ return t('forms', 'No recommendations. Start typing.')
}
return t('forms', 'No elements found.')
},
@@ -308,7 +301,7 @@ export default {