Skip to content

Commit 036776c

Browse files
Add search shortcut support
Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
1 parent edd1e18 commit 036776c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/App.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
-->
2121

2222
<template>
23-
<Content :class="{ 'icon-loading': loading, 'in-call': isInCall }" app-name="Talk">
23+
<Content
24+
v-shortkey="['ctrl', 'f']"
25+
:class="{ 'icon-loading': loading, 'in-call': isInCall }"
26+
app-name="Talk"
27+
@shortkey.native="handleAppSearch">
2428
<LeftSidebar v-if="getUserId && !isFullscreen" />
2529
<AppContent>
2630
<router-view />
@@ -380,6 +384,10 @@ export default {
380384
this.$store.dispatch('hideSidebar')
381385
}
382386
},
387+
// Upon pressing ctrl+f, focus the search box in the left sidebar
388+
handleAppSearch() {
389+
document.querySelector('.conversations-search')[0].focus()
390+
},
383391
},
384392
}
385393
</script>

src/components/LeftSidebar/LeftSidebar.vue

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<div class="new-conversation">
2525
<SearchBox
2626
v-model="searchText"
27+
class="conversations-search"
2728
:is-searching="isSearching"
2829
@input="debounceFetchSearchResults"
2930
@abort-search="abortSearch" />

0 commit comments

Comments
 (0)