Page MenuHomePhabricator

D8000.id27092.diff
No OneTemporary

D8000.id27092.diff

diff --git a/native/account/registration/password-selection.react.js b/native/account/registration/password-selection.react.js
--- a/native/account/registration/password-selection.react.js
+++ b/native/account/registration/password-selection.react.js
@@ -1,7 +1,9 @@
// @flow
import * as React from 'react';
-import { View, Text } from 'react-native';
+import { View, Text, Platform } from 'react-native';
+
+import sleep from 'lib/utils/sleep.js';
import RegistrationButtonContainer from './registration-button-container.react.js';
import RegistrationButton from './registration-button.react.js';
@@ -75,6 +77,18 @@
confirmPasswordInputRef.current?.focus();
}, []);
+ /* eslint-disable react-hooks/rules-of-hooks */
+ const passwordInputRef = React.useRef();
+ if (Platform.OS === 'android') {
+ React.useEffect(() => {
+ (async () => {
+ await sleep(250);
+ passwordInputRef.current?.focus();
+ })();
+ }, []);
+ }
+ /* eslint-enable react-hooks/rules-of-hooks */
+
return (
<RegistrationContainer>
<RegistrationContentContainer>
@@ -83,13 +97,17 @@
value={password}
onChangeText={setPassword}
placeholder="Password"
- autoFocus={true}
+ autoFocus={Platform.select({
+ android: false,
+ default: true,
+ })}
secureTextEntry={true}
textContentType="newPassword"
autoComplete="password-new"
returnKeyType="next"
onSubmitEditing={focusConfirmPasswordInput}
onBlur={potentiallyClearErrors}
+ ref={passwordInputRef}
/>
<RegistrationTextInput
value={confirmPassword}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 28, 4:35 AM (7 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2723686
Default Alt Text
D8000.id27092.diff (1 KB)

Event Timeline