Skip to content

Commit

Permalink
Close sidebar on tag search
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAndBear committed Nov 8, 2023
1 parent c215397 commit dc1a819
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
>
<template #selected-option-container="{ option, deselect }">
<oc-tag class="tags-control-tag oc-ml-xs" :rounded="true" size="small">
<router-link class="oc-flex oc-flex-middle" :to="generateTagLink(option.label)">
<router-link
class="oc-flex oc-flex-middle"
:to="generateTagLink(option.label)"
@click="onTagClicked"
>
<oc-icon name="price-tag-3" class="oc-mr-xs" size="small" />
<span class="oc-text-truncate">{{ option.label }}</span>
</router-link>
Expand Down Expand Up @@ -65,8 +69,8 @@ import {
import {
createLocationCommon,
eventBus,
SideBarEventTopics,
useClientService,
useGetMatchingSpace,
useRouter,
useStore
} from '@ownclouders/web-pkg'
Expand Down Expand Up @@ -98,8 +102,6 @@ export default defineComponent({
setup(props) {
const store = useStore()
const clientService = useClientService()
const { getMatchingSpace } = useGetMatchingSpace()
const language = useGettext()
const $router = useRouter()
const resource = toRef(props, 'resource')
Expand All @@ -119,6 +121,10 @@ export default defineComponent({
return [...unref(resource).tags.map((t) => ({ label: t }))]
})
const onTagClicked = () => {
eventBus.publish(SideBarEventTopics.close)
}
const loadAvailableTagsTask = useTask(function* () {
const {
data: { value: tags = [] }
Expand Down Expand Up @@ -257,7 +263,8 @@ export default defineComponent({
keycode,
keydownMethods,
readonly,
generateTagLink
generateTagLink,
onTagClicked
}
}
})
Expand Down

0 comments on commit dc1a819

Please sign in to comment.