focus form on enter
This commit is contained in:
parent
3762507c27
commit
1f7856d6ae
|
@ -59,7 +59,7 @@ export default React.createClass({
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" placeholder="user/repo" autoComplete="off"
|
<input type="text" ref="el" placeholder="user/repo" autoComplete="off"
|
||||||
onChange={this._onChange} value={this.state.val} onKeyUp={this._onKeyUp} />
|
onChange={this._onChange} value={this.state.val} onKeyUp={this._onKeyUp} />
|
||||||
</td>
|
</td>
|
||||||
<td><a onClick={this._onAdd}>Add</a></td>
|
<td><a onClick={this._onAdd}>Add</a></td>
|
||||||
|
@ -74,6 +74,10 @@ export default React.createClass({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
this.refs.el.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue