The iOS automatically fills the first password field but not on the second. How to make password and confirm password fields autofilled like in apps out there?
Update: It seems that system treats Signup form like a Login form, so it autofills first password field. Also, when I navigate back to login screen, system prompts whether I want to save password in keychain or not, which is unexpected.
Update: I'm using stack navigation (screens: Login and Signup). Turns out after I type name or email in signup form, it autofills strong password to password field of Login screen and first password field of Signup screen. Any way to tell system that those are different forms? (Like using different <form>
in web programming).
Login Screen
export default class Login extends Component {
Login() {
}
render() {
return (
<IndexBackground>
<IndexBox>
<IndexLogo />
<IndexTextInput placeholder="Name" />
<IndexTextInput placeholder="Password" secureTextEntry={true}/>
<IndexButton title="Log in" onPress={this.Login} />
<IndexText text="Forgot Password?" style={styles.textForgot} />
<IndexText text="Don't have an account?" style={styles.textSignUp}>
<Text style={styles.textLink} onPress={() => this.props.navigation.navigate('SignUp')}> Sign up</Text>
</IndexText>
</IndexBox>
</IndexBackground>
)
}
}
SignUp Screen
export default class SignUp extends Component {
user = {
email: '',
name: '',
pass: '',
confirmpass: ''
};
setUser = (key, value) => {
this.user[key] = value;
console.log(this.user);
}
signUp() {
}
render() {
return (
<IndexBackground>
<IndexBox>
<IndexLogo />
<IndexTextInput placeholder="Email" onTextChanged={(value) => this.setUser('email', value)} />
<IndexTextInput placeholder="Name" onTextChanged={(value) => this.setUser('name', value)} />
<IndexTextInput placeholder="Password" secureTextEntry={true} onTextChanged={(value) => this.setUser('pass', value)} />
<IndexTextInput placeholder="Confirm Password" secureTextEntry={true} onTextChanged={(value) => this.setUser('confirmpass', value)} />
<IndexButton title="Sign up" onPress={this.signUp} />
<IndexText text="Have an account?" style={styles.textSignUp}>
<Text style={styles.textLink} onPress={() => this.props.navigation.navigate('Login')}> Log in</Text>
</IndexText>
</IndexBox>
</IndexBackground>
)
}
}
NavLogin
const routeConfigs = {
Login: { screen: Login },
SignUp: { screen: SignUp }
}
const navConfigs = {
headerMode: 'none',
navigationOptions: {
headerVisible: false,
}
}
const NavLogin = createStackNavigator(routeConfigs, navConfigs);
const ContainerLogin = createAppContainer(NavLogin);
export default ContainerLogin;
Automatically create a strong password If you don't have iCloud Keychain set up, click in the password field, click the AutoFill Key , then choose Suggest New Password.
For supported websites and apps, iPhone suggests a unique, complex password. Do one of the following: Choose the suggested password: Tap Use Strong Password. Edit the suggested password: Tap Other Options, tap Edit Strong Password, tap the password text field, then make your changes.
Check Sync Settings If any passwords, payment methods, or addresses you save on a certain device don't show up on another for auto-filling, you must review your Chrome Sync settings for each device. Open the Chrome menu, click or tap Settings, and then select Sync and Google Services.
On your iPhone, iPad, or iPod touch with iOS 10 or later iOS 14 or later: Go to Settings > Passwords > AutoFill Passwords. Check that AutoFill Passwords is turned on. iOS 12 or 13: Go to Settings > Passwords & Accounts > Website & App Passwords. Check that AutoFill Passwords is turned on.
Have the same bug with createStackNavigator and IOS strong passwords.
I think this happens because stack navigator does not unmount inactive components and IOS can interact with them. I added subscription to onFocus event (withNavigationFocus) for login form and render empty login form for unfocused state (when signup is active):
import { withNavigationFocus } from 'react-navigation';
...
class Login extends Component {
Login() {
}
render() {
if (!this.props.isFocused) return null;
return (
<IndexBackground>
...
</IndexBackground>
)
}
}
export default withNavigationFocus(Login);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With