Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Focus not moving cursor [React Native]

$
0
0

When I use a functional component, the focus does not move the cursor when focus is changed. The Input changes accordingly (label floats), but the cursor remains on the first input.

I have seen solutions with refs, but I think this should be working too

...useStates for values and functions        const [passwordFocus, setPasswordFocus] = React.useState(false);    return (       ....<Input          label={"Username or Email"}          value={username}          onChangeText={(value) => setUsername(value)}          returnKeyType="next"          blurOnSubmit={false}          onSubmitEditing={() => {            setPasswordFocus(true);          }}          autoCapitalize="none"          autoCompleteType="email"          autoFocus={true}          underlineColorAndroid="transparent"        /><Input          label={"Password"}          isPassword          value={password}          onChangeText={(value) => setPassword(value)}          isFocused={passwordFocus}          onBlur={() => setPasswordFocus(false)}          blurOnSubmit={true}          returnKeyType="send"          autoCompleteType="password"          underlineColorAndroid="transparent"          onSubmitEditing={handleLogin}        />    ....    )

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>