From c550d46f863de22e7d28f82edadd5ee2fabd1d8b Mon Sep 17 00:00:00 2001 From: boryslevytskyi Date: Sat, 13 May 2017 22:35:13 +0300 Subject: [PATCH] Add autofocus for name input --- src/app/components/InputBox.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/components/InputBox.jsx b/src/app/components/InputBox.jsx index 65c0be1..751dd2a 100644 --- a/src/app/components/InputBox.jsx +++ b/src/app/components/InputBox.jsx @@ -8,8 +8,13 @@ export default class InputBox extends React.Component { this.historyIndex = 0; } + componentDidMount(){ + this.nameInput.focus(); + } + render() { return { this.nameInput = input; }} onKeyUp={e => this.onKeyUp(e)} onKeyDown={e => this.onKeyDown(e)} className="expressionInput mono"