Skip to content

Using KeyboardAvoidingView with IOS causes Flickering whilst changing input #987

@cSieves

Description

@cSieves

Describe the bug
I have an input form with multiple inputs and I allow the user to hit enter to move to the next input box. When I do this on IOS the page jumps/flickers. I think this is because the suggestion box above the keyboard momentarily disappears.

Code snippet

        <KeyboardAvoidingView style={{flex: 1}} behavior={"padding"}>
            <ScrollView contentContainerStyle={styles.container}>
                <View style={{width: '70%'}}>
                    <Controller
                        control={control}
                        render={({field: {onChange, value}}) => (
                            <TextField
                                style={CreateAccountStyles.input}
                                ref={emailInputRef}
                                placeholder="Email"
                                placeholderTextColor='lightgrey'
                                onChangeText={onChange}
                                onBlur={() => handleBlur("email")}
                                value={value}
                                error={errors.email?.message}
                                returnKeyType="next"
                                keyboardType="email-address"
                                onSubmitEditing={() => passwordInputRef.current?.focus()}
                            />
                        )}
                        name="email"
                    />

                    <Controller
                        control={control}
                        render={({field: {onChange, value}}) => (
                            <TextField
                                style={CreateAccountStyles.input}
                                ref={passwordInputRef}
                                placeholder="Password"
                                placeholderTextColor='lightgrey'
                                clearsOnBeginEditing={false}
                                secureTextEntry={!showPassword}
                                onChangeText={onChange}
                                onBlur={() => handleBlur("password")}
                                value={value}
                                error={errors.password?.message}
                                returnKeyType="done"
                                onSubmitEditing={() => handleSubmit(handleLogin)}  // Focus next field (email)
                                renderRightAccessory={() => (
                                    Platform.OS !== "ios" ?
                                        <TouchableOpacity
                                            onPress={() => setShowPassword(!showPassword)}>
                                            <Ionicons
                                                size={24}
                                                name={!showPassword ? 'eye-off' : 'eye'}
                                                color="gray"
                                            />
                                        </TouchableOpacity>
                                        : <></>
                                )}
                            />
                        )}
                        name="password"
                    />
                </View>
            </ScrollView>
        </KeyboardAvoidingView>

Repo for reproducing
I would be highly appreciate if you can provide repository for reproducing your issue. It can significantly reduce the time for discovering and fixing the problem.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
Screen not to flicker.

Screenshots

ScreenRecording_06-18-2025.22-18-29_1.MP4

Smartphone (please complete the following information):

  • Desktop OS: mac m3
  • Device: iphone 13
  • OS: IOS 18.5
  • RN version: 0.76.2
  • RN architecture: new
  • JS engine: hermes
  • Library version: 1.17.5

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

KeyboardAvoidingView 🧪Anything related to KeyboardAvoidingView componentrepro providedIssue contains reproduction repository/code🍎 iOSiOS specific🔥 AttentionAn issue, that requires attention (disturbs many users/has many reactions)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions