diff --git a/src/web/app/common/views/components/messaging.vue b/src/web/app/common/views/components/messaging.vue index 2e81325cb..386e705b0 100644 --- a/src/web/app/common/views/components/messaging.vue +++ b/src/web/app/common/views/components/messaging.vue @@ -6,38 +6,45 @@
-
    -
  1. +
  2. - - { user.name } - @{ user.username } + + {{ user.name }} + @{{ user.username }}
-
- @@ -123,26 +130,29 @@ export default Vue.extend({ } }, onSearchResultKeydown(i, e) { + const list = this.$refs.searchResult as any; + const cancel = () => { e.preventDefault(); e.stopPropagation(); }; + switch (true) { case e.which == 27: // [ESC] cancel(); - this.$refs.search.focus(); + (this.$refs.search as any).focus(); break; case e.which == 9 && e.shiftKey: // [TAB] + [Shift] case e.which == 38: // [↑] cancel(); - (this.$refs.searchResult.childNodes[i].previousElementSibling || this.$refs.searchResult.childNodes[this.searchResult.length - 1]).focus(); + (list.childNodes[i].previousElementSibling || list.childNodes[this.result.length - 1]).focus(); break; case e.which == 9: // [TAB] case e.which == 40: // [↓] cancel(); - (this.$refs.searchResult.childNodes[i].nextElementSibling || this.$refs.searchResult.childNodes[0]).focus(); + (list.childNodes[i].nextElementSibling || list.childNodes[0]).focus(); break; } } @@ -150,7 +160,6 @@ export default Vue.extend({ }); -