From f617da4096e990c304cb0da21db3550311868e52 Mon Sep 17 00:00:00 2001 From: chris-chao Date: Mon, 20 Aug 2018 23:52:36 -0500 Subject: [PATCH] [Ignore Keyboard Actions With Modifiers #60] ignore left/right arrow action triggers if user is holding down alt key --- src/components/KeyboardInteraction/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/KeyboardInteraction/index.ts b/src/components/KeyboardInteraction/index.ts index 7ba7b64..36d7351 100644 --- a/src/components/KeyboardInteraction/index.ts +++ b/src/components/KeyboardInteraction/index.ts @@ -32,12 +32,16 @@ class KeyboardInteractionInner extends Component { switch (e.code) { case 'ArrowLeft': case 'KeyH': - this.props.previousSong(); + if (!e.altKey){ + this.props.previousSong(); + } break; case 'ArrowRight': case 'KeyL': - this.props.nextSong(); + if (!e.altKey){ + this.props.nextSong(); + } break; case 'Space':