From c9fbe61d2b1b861fe0177c0f57554706cbdc9249 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Wed, 26 May 2021 18:44:32 +0100 Subject: [PATCH] Browsers already do what these listeners were doing --- src/components/sidebar/CollapsibleSection.vue | 12 +----------- src/components/sidebar/FollowTarget.vue | 11 +---------- src/components/sidebar/ServerListItem.vue | 12 +----------- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/src/components/sidebar/CollapsibleSection.vue b/src/components/sidebar/CollapsibleSection.vue index 5607db4..63f9025 100644 --- a/src/components/sidebar/CollapsibleSection.vue +++ b/src/components/sidebar/CollapsibleSection.vue @@ -1,7 +1,7 @@ @@ -60,13 +59,6 @@ export default defineComponent({ unfollow = () => { useStore().commit(MutationTypes.CLEAR_FOLLOW_TARGET, undefined); }, - onKeydown = (e: KeyboardEvent) => { - if(e.key !== ' ') { - return; - } - - unfollow(); - }, updatePlayerImage = async () => { image.value = defaultImage; @@ -83,7 +75,6 @@ export default defineComponent({ return { image, - onKeydown, unfollow, heading, messageUnfollow, diff --git a/src/components/sidebar/ServerListItem.vue b/src/components/sidebar/ServerListItem.vue index 00e4a3e..1ebf826 100644 --- a/src/components/sidebar/ServerListItem.vue +++ b/src/components/sidebar/ServerListItem.vue @@ -18,7 +18,7 @@
  • @@ -48,16 +48,6 @@ export default defineComponent({ }, methods: { - handleKeydown(e: KeyboardEvent, serverId: string) { - if(e.key !== ' ' && e.key !== 'Enter') { - return; - } - - e.preventDefault(); - - this.setCurrentServer(serverId); - }, - setCurrentServer(serverId: string) { useStore().commit(MutationTypes.SET_CURRENT_SERVER, serverId); }