From a05cfde9d7b0003e7e65d0abb9263ca36210926a Mon Sep 17 00:00:00 2001 From: James Lyne Date: Wed, 26 May 2021 18:49:11 +0100 Subject: [PATCH] Fix player keyboard interaction --- src/components/sidebar/PlayerListItem.vue | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/components/sidebar/PlayerListItem.vue b/src/components/sidebar/PlayerListItem.vue index 2d692d2..bfe511d 100644 --- a/src/components/sidebar/PlayerListItem.vue +++ b/src/components/sidebar/PlayerListItem.vue @@ -19,8 +19,7 @@ @@ -60,6 +59,7 @@ export default defineComponent({ pan = () => { if(!props.player.hidden) { + console.log('clear?'); store.commit(MutationTypes.CLEAR_FOLLOW_TARGET, undefined); store.commit(MutationTypes.SET_PAN_TARGET, props.player); } @@ -67,17 +67,12 @@ export default defineComponent({ follow = () => store.commit(MutationTypes.SET_FOLLOW_TARGET, props.player), - onKeydown = (e: KeyboardEvent) => { - if(e.key !== ' ' && e.key !== 'Enter') { - return; - } - + onClick = (e: MouseEvent) => { if(e.shiftKey) { follow(); + e.preventDefault(); } else { - if(!props.player.hidden) { - pan(); - } + pan(); } }; @@ -95,7 +90,7 @@ export default defineComponent({ otherWorld, pan, follow, - onKeydown + onClick } },