Skip to content

Commit 272a5c7

Browse files
committed
Merge pull request #7 from jrichardlai/fix-login-field-on-submit-editing
Fix enter key for username field
2 parents 621b489 + f09f6b0 commit 272a5c7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

App/Components/TextInput.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ var cssVar = require('../Lib/cssVar');
99
var TextInput = React.createClass({
1010
propTypes: React.TextInput.propTypes,
1111

12+
focus() {
13+
this.refs.input.focus();
14+
},
15+
1216
setNativeProps() {
1317
var input = this.refs.input;
1418
input.setNativeProps.apply(input, arguments);
1519
},
20+
1621
render() {
1722
return (
1823
<React.TextInput

App/Mixins/AuthHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var AuthHelper = {
8585
enablesReturnKeyAutomatically={true}
8686
returnKeyType='next'
8787
onChange={(event) => this.state.username = event.nativeEvent.text }
88-
onSubmitEditing={(event) => this.refs.password.focus() }
88+
onSubmitEditing={() => this.refs.password.focus() }
8989
/>
9090
<TextInput ref="password"
9191
placeholder={'Password'}
@@ -164,4 +164,4 @@ var styles = StyleSheet.create({
164164
},
165165
});
166166

167-
module.exports = AuthHelper;
167+
module.exports = AuthHelper;

0 commit comments

Comments
 (0)