Browse Source

fix: resolve field ref problem

pull/6291/head
mehmet-erim 6 years ago
parent
commit
7f99293b20
  1. 5
      templates/app/react-native/src/screens/CreateUpdateUser/CreateUpdateUserForm.js
  2. 6
      templates/app/react-native/src/screens/CreateUpdateUser/CreateUpdateUserScreen.js

5
templates/app/react-native/src/screens/CreateUpdateUser/CreateUpdateUserForm.js

@ -138,7 +138,7 @@ function CreateUpdateUserForm({ editingUser = {}, submit, remove }) {
<Input
abpInput
ref={emailRef}
onSubmitEditing={() => passwordRef.current._root.focus()}
onSubmitEditing={() => phoneNumberRef.current._root.focus()}
returnKeyType="next"
onChangeText={handleChange('email')}
onBlur={handleBlur('email')}
@ -151,7 +151,8 @@ function CreateUpdateUserForm({ editingUser = {}, submit, remove }) {
<Label abpLabel>{i18n.t('AbpIdentity::PhoneNumber')}</Label>
<Input
abpInput
ref={passwordRef}
ref={phoneNumberRef}
onSubmitEditing={() => passwordRef.current._root.focus()}
returnKeyType={!editingUser.id ? 'next' : 'default'}
onChangeText={handleChange('phoneNumber')}
onBlur={handleBlur('phoneNumber')}

6
templates/app/react-native/src/screens/CreateUpdateUser/CreateUpdateUserScreen.js

@ -23,11 +23,11 @@ function CreateUpdateUserScreen({ navigation, route, startLoading, stopLoading }
}
}, []);
const submit = data => {
const submit = (data) => {
startLoading({ key: 'saveUser' });
let request;
if (data.id) {
request = updateUser(data, userId)
request = updateUser(data, userId);
} else {
request = createUser(data);
}
@ -61,7 +61,7 @@ CreateUpdateUserScreen.propTypes = {
export default connectToRedux({
component: CreateUpdateUserScreen,
stateProps: state => ({ loading: createLoadingSelector()(state) }),
stateProps: (state) => ({ loading: createLoadingSelector()(state) }),
dispatchProps: {
startLoading: LoadingActions.start,
stopLoading: LoadingActions.stop,

Loading…
Cancel
Save