From 5a706e1e9d328ca349df2bae915fb779f7d43717 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Tue, 24 Jan 2017 18:26:42 -0500 Subject: [PATCH] riek submit on enter --- frontend/src/components/TopicCard.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/components/TopicCard.js b/frontend/src/components/TopicCard.js index a0f0b8d7..d41b3720 100644 --- a/frontend/src/components/TopicCard.js +++ b/frontend/src/components/TopicCard.js @@ -299,6 +299,15 @@ class ReactTopicCard extends Component { className="titleWrapper" id="titleActivator" classEditing="riek-editing" + editProps={{ + onKeyPress: e => { + const ENTER = 13 + if (e.which === ENTER) { + e.preventDefault() + this.props.updateTopic({ name: e.target.value }) + } + } + }} />