diff --git a/ext/src/ui/popup/index.tsx b/ext/src/ui/popup/index.tsx index 9c91267..7c3b468 100755 --- a/ext/src/ui/popup/index.tsx +++ b/ext/src/ui/popup/index.tsx @@ -270,21 +270,25 @@ class ReceiverEntry extends Component { , showAlternateAction: false }; - window.addEventListener("keydown", ev => { - if (ev.key === "Alt") { + const handleActionKeyEvents = (ev: KeyboardEvent) => { + if (ev.key === "Alt" || ev.key === "Shift") { this.setState({ - showAlternateAction: true - }); - } - }); - window.addEventListener("keyup", ev => { - if (ev.key === "Alt") { - this.setState({ - showAlternateAction: false + // Only enable on keydown, otherwise disable + showAlternateAction: ev.type === "keydown" }); } + } + + window.addEventListener("keydown", handleActionKeyEvents); + window.addEventListener("keyup", handleActionKeyEvents); + + window.addEventListener("blur", () => { + this.setState({ + showAlternateAction: false + }); }); + this.handleCast = this.handleCast.bind(this); }