From c8568b54293beb4b85eaf4a32ac558cc6948a8bd Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 13 Feb 2019 10:19:29 +0200 Subject: [PATCH] Redirect pageup/pagedown without manually animating the scroll --- client/components/ChatUserList.vue | 14 +++++++----- client/components/MessageList.vue | 3 ++- client/css/style.css | 1 + client/js/keybinds.js | 35 +++++------------------------- 4 files changed, 18 insertions(+), 35 deletions(-) diff --git a/client/components/ChatUserList.vue b/client/components/ChatUserList.vue index 10917994..60240f0d 100644 --- a/client/components/ChatUserList.vue +++ b/client/components/ChatUserList.vue @@ -13,10 +13,10 @@ aria-label="Search among the user list" tabindex="-1" @input="setUserSearchInput" - @keydown.up="navigateUserList(-1)" - @keydown.down="navigateUserList(1)" - @keydown.page-up="navigateUserList(-10)" - @keydown.page-down="navigateUserList(10)" + @keydown.up="navigateUserList($event, -1)" + @keydown.down="navigateUserList($event, 1)" + @keydown.page-up="navigateUserList($event, -10)" + @keydown.page-down="navigateUserList($event, 10)" @keydown.enter="selectUser">
@@ -146,7 +146,11 @@ export default { removeHoverUser() { this.activeUser = null; }, - navigateUserList(direction) { + navigateUserList(event, direction) { + // Prevent propagation to stop global keybind handler from capturing pagedown/pageup + // and redirecting it to the message list container for scrolling + event.stopImmediatePropagation(); + let users = this.channel.users; // Only using filteredUsers when we have to avoids filtering when it's not needed diff --git a/client/components/MessageList.vue b/client/components/MessageList.vue index 3ac2c5e7..012f6451 100644 --- a/client/components/MessageList.vue +++ b/client/components/MessageList.vue @@ -1,7 +1,8 @@