Bluesky app fork with some witchin' additions 💫

fix android 2fa input not being paste-able (#9407)

authored by samuel.fm and committed by GitHub 9823bc98 f57268e9

Changed files
+6 -16
src
screens
+6 -16
src/screens/Login/LoginForm.tsx
··· 65 65 const [isProcessing, setIsProcessing] = useState<boolean>(false) 66 66 const [isAuthFactorTokenNeeded, setIsAuthFactorTokenNeeded] = 67 67 useState<boolean>(false) 68 - const [isAuthFactorTokenValueEmpty, setIsAuthFactorTokenValueEmpty] = 69 - useState<boolean>(true) 70 68 const identifierValueRef = useRef<string>(initialHandle || '') 71 69 const passwordValueRef = useRef<string>('') 72 - const authFactorTokenValueRef = useRef<string>('') 70 + const [authFactorToken, setAuthFactorToken] = useState('') 73 71 const identifierRef = useRef<TextInput>(null) 74 72 const passwordRef = useRef<TextInput>(null) 75 73 const hasFocusedOnce = useRef<boolean>(false) ··· 91 89 92 90 const identifier = identifierValueRef.current.toLowerCase().trim() 93 91 const password = passwordValueRef.current 94 - const authFactorToken = authFactorTokenValueRef.current 95 92 96 93 if (!identifier) { 97 94 setError(_(msg`Please enter your username`)) ··· 290 287 autoCorrect={false} 291 288 autoComplete="one-time-code" 292 289 returnKeyType="done" 293 - textContentType="username" 294 290 blurOnSubmit={false} // prevents flickering due to onSubmitEditing going to next field 295 - onChangeText={v => { 296 - setIsAuthFactorTokenValueEmpty(v === '') 297 - authFactorTokenValueRef.current = v 298 - }} 291 + onChangeText={setAuthFactorToken} 292 + value={authFactorToken} // controlled input due to uncontrolled input not receiving pasted values properly 299 293 onSubmitEditing={onPressNext} 300 294 editable={!isProcessing} 301 295 accessibilityHint={_( 302 296 msg`Input the code which has been emailed to you`, 303 297 )} 304 - style={[ 305 - { 306 - textTransform: isAuthFactorTokenValueEmpty 307 - ? 'none' 308 - : 'uppercase', 309 - }, 310 - ]} 298 + style={{ 299 + textTransform: authFactorToken === '' ? 'none' : 'uppercase', 300 + }} 311 301 /> 312 302 </TextField.Root> 313 303 <Text style={[a.text_sm, t.atoms.text_contrast_medium, a.mt_sm]}>