Skip to content

Commit 4d28439

Browse files
committed
feat: Access to Filters using keyboard - MEED-9239 - Meeds-io/MIPs#193 (#4916)
1 parent 14b38d9 commit 4d28439

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

webapp/src/main/webapp/vue-apps/search/components/SearchOptions.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2626
:aria-pressed="favorites"
2727
:aria-label="$t('search.filter.favorite')"
2828
class="ms-1 me-2 text-body border-color flex-shrink-0"
29+
tabindex="0"
30+
@keydown.enter="$emit('select-favorites')"
2931
@click="$emit('select-favorites')">
3032
<v-icon size="16" class="pe-2 yellow--text text--darken-2">
3133
fas fa-star
@@ -47,7 +49,9 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4749
:aria-label="$t('search.filter.type')"
4850
v-bind="attrs"
4951
v-on="on"
50-
class="text-body text-header-color ms-2 flex-shrink-0">
52+
tabindex="0"
53+
class="text-body text-header-color ms-2 flex-shrink-0"
54+
@keydown.enter="on.click">
5155
<v-icon size="16" class="pe-2">
5256
fas fa-paste
5357
</v-icon>

webapp/src/main/webapp/vue-apps/search/components/SearchTagList.vue

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
:nudge-left="isMobile && 300"
77
:nudge-bottom="30"
88
content-class="tag-search-content"
9+
attach
910
offset-x>
1011
<template #activator="{ on, attrs }">
1112
<v-chip
1213
:outlined="!open"
1314
:color="open && 'primary' || ''"
1415
:aria-label="$t('search.filter.tag')"
16+
tabindex="0"
1517
class="text-body text-header-color mx-1"
1618
v-bind="attrs"
17-
v-on="on">
19+
v-on="on"
20+
@keydown.enter="on.click">
1821
<v-icon size="16" class="pe-2">
1922
fas fa-hashtag
2023
</v-icon>
@@ -25,6 +28,7 @@
2528
<v-text-field
2629
ref="tagSearchInput"
2730
v-model="query"
31+
autofocus
2832
:placeholder="$t('Tag.search.placeholder')"
2933
class="px-4" />
3034
<div class="pa-3">
@@ -91,26 +95,11 @@ export default {
9195
open() {
9296
if (this.open) {
9397
this.query = '';
94-
window.setTimeout(() => {
95-
if (this.$refs.tagSearchInput) {
96-
this.$refs.tagSearchInput.$el.querySelector('input').focus();
97-
}
98-
}, 200);
9998
this.search();
10099
}
101100
},
102101
},
103102
created() {
104-
// Workaround to fix closing menu when clicking outside
105-
document.onmousedown = event => {
106-
if (this.open && event && event.target) {
107-
if (!$('.tag-search-content').find(event.target).length) {
108-
window.setTimeout(() => {
109-
this.open = false;
110-
}, 200);
111-
}
112-
}
113-
};
114103
this.selectedTags = this.value;
115104
},
116105
methods: {

0 commit comments

Comments
 (0)