= 3
+ )
+ },
isFirstOfType(option) {
return (
this.options.findIndex((o) => o === option) ===
@@ -103,49 +109,36 @@ export default {
onFocus(event) {
clearTimeout(this.searchProcess)
},
- handleInput(event) {
+ onInput(event) {
clearTimeout(this.searchProcess)
this.value = event.target ? event.target.value.replace(/\s+/g, ' ').trim() : ''
- this.unprocessedSearchInput = this.value
- if (isEmpty(this.value) || this.value.replace(/\s+/g, '').length < 3) {
+ if (!this.isSearchable()) {
+ this.$emit('clearSearch')
return
}
this.searchProcess = setTimeout(() => {
- this.previousSearchTerm = this.value
this.$emit('query', this.value)
}, this.delay)
},
onEnter(event) {
this.$router.push({
path: '/search/search-results',
- query: { search: this.unprocessedSearchInput },
+ query: { search: this.value },
})
- this.$emit('clearSearch')
- },
- onDelete(event) {
- clearTimeout(this.searchProcess)
- const value = event.target ? event.target.value.trim() : ''
- if (isEmpty(value)) {
- this.clear()
- } else {
- this.handleInput(event)
- }
+ this.$refs.select.close()
},
clear() {
- this.unprocessedSearchInput = ''
- this.previousSearchTerm = ''
- this.searchValue = ''
+ this.value = ''
this.$emit('clearSearch')
clearTimeout(this.searchProcess)
},
onBlur(event) {
- this.searchValue = this.previousSearchTerm
clearTimeout(this.searchProcess)
},
onSelect(item) {
this.goToResource(item)
this.$nextTick(() => {
- this.searchValue = this.previousSearchTerm
+ this.value = this.$refs.select.$data.searchString
})
},
getRouteName(item) {
diff --git a/webapp/graphql/groups.js b/webapp/graphql/groups.js
index bb5292675..6aedc205d 100644
--- a/webapp/graphql/groups.js
+++ b/webapp/graphql/groups.js
@@ -207,6 +207,9 @@ export const groupMembersQuery = () => {
name
slug
myRoleInGroup
+ avatar {
+ url
+ }
}
}
`