Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32468283
D8000.1765374117.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8000.1765374117.diff
View Options
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,20 @@
confirmPasswordInputRef.current?.focus();
}, []);
+ /* eslint-disable react-hooks/rules-of-hooks */
+ const passwordInputRef = React.useRef();
+ if (Platform.OS === 'android') {
+ // It's okay to call this hook conditionally because
+ // the condition is guaranteed to never change
+ React.useEffect(() => {
+ (async () => {
+ await sleep(250);
+ passwordInputRef.current?.focus();
+ })();
+ }, []);
+ }
+ /* eslint-enable react-hooks/rules-of-hooks */
+
return (
<RegistrationContainer>
<RegistrationContentContainer>
@@ -83,13 +99,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
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 10, 1:41 PM (19 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5864111
Default Alt Text
D8000.1765374117.diff (1 KB)
Attached To
Mode
D8000: [native] Delay PasswordSelection autoFocus on Android
Attached
Detach File
Event Timeline
Log In to Comment