From ff89e2849673a03aa7add44cf44ee83f9a5aacc1 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 2 Sep 2017 13:38:52 -0700 Subject: [PATCH] Fixes: Hitting 'e' shortcut should not add an e to the document --- frontend/components/Layout/Layout.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/components/Layout/Layout.js b/frontend/components/Layout/Layout.js index b22c3eaeb..9679eb833 100644 --- a/frontend/components/Layout/Layout.js +++ b/frontend/components/Layout/Layout.js @@ -69,9 +69,13 @@ type Props = { } @keydown('e') - goToEdit() { - if (!this.props.documents.active) return; - this.props.history.push(documentEditUrl(this.props.documents.active)); + goToEdit(ev) { + const activeDocument = this.props.documents.active; + if (!activeDocument) return; + + ev.preventDefault(); + ev.stopPropagation(); + this.props.history.push(documentEditUrl(activeDocument)); } handleLogout = () => {