Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions core/src/views/UnifiedSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
:key="type"
icon="icon-filter"
:title="t('core', 'Search for {name} only', { name: typesMap[type] })"
@click="onClickFilter(`in:${type}`)">
@click.stop="onClickFilter(`in:${type}`)">
{{ `in:${type}` }}
</NcActionButton>
</NcActions>
Expand Down Expand Up @@ -141,7 +141,7 @@
? t('core', 'Loading more results …')
: t('core', 'Load more results')"
:icon-class="loading[type] ? 'icon-loading-small' : ''"
@click.prevent="loadMore(type)"
@click.stop="loadMore(type)"
@focus="setFocusedIndex" />
</li>
</ul>
Expand Down Expand Up @@ -272,7 +272,7 @@ export default {
let match
const filters = []
while ((match = regexFilterIn.exec(this.query)) !== null) {
filters.push(match[1])
filters.push(match[2])
}
return filters
},
Expand All @@ -286,7 +286,7 @@ export default {
let match
const filters = []
while ((match = regexFilterNot.exec(this.query)) !== null) {
filters.push(match[1])
filters.push(match[2])
}
return filters
},
Expand Down Expand Up @@ -469,6 +469,13 @@ export default {
// Reset search if the query changed
await this.resetState()
this.triggered = true

if (!types.length) {
// no results since no types were selected
this.logger.error('No types to search in')
return
}

this.$set(this.loading, 'all', true)
this.logger.debug(`Searching ${query} in`, types)

Expand Down
4 changes: 2 additions & 2 deletions dist/core-unified-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unified-search.js.map

Large diffs are not rendered by default.