Skip to content

Commit

Permalink
Handle CTRL-N & CTRL-P to cycle through search results
Browse files Browse the repository at this point in the history
Better style of search result task item
  • Loading branch information
SakiiR committed Dec 20, 2021
1 parent 866db6a commit ef5449c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions front/src/components/Dialogs/SearchDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
@click="onItemSelected(item)"
>
<q-item-section>
{{ !!item.ctf ? item.ctf.title + '/' : '' }}
<b>{{ item.title }}</b></q-item-section
>
<span>
{{ !!item.ctf ? item.ctf.title + ' / ' : '' }}
<b>{{ item.title }}</b>
</span>
</q-item-section>

<q-item-section side top>
<q-badge color="teal" :label="item.__typename" />
Expand Down Expand Up @@ -72,11 +74,11 @@ export default defineComponent({
},
methods: {
searchInputKeyDown(e: KeyboardEvent) {
if (e.key === 'ArrowDown') {
if (e.key === 'ArrowDown' || (e.ctrlKey && e.key === 'n')) {
this.selectedItemIndex += 1;
}
if (e.key === 'ArrowUp') {
if (e.key === 'ArrowUp' || (e.ctrlKey && e.key === 'p')) {
this.selectedItemIndex += -1;
}
Expand Down

0 comments on commit ef5449c

Please sign in to comment.