Skip to content

Bad sizing calculations when navigation to a screen with a TextInput with autoFocus enabled #759

@danieljvdm

Description

@danieljvdm

When using KeyboardAvoidingView with a textinput that has autoFocus set to true, the sizing calculations are bad when pushing a screen. Using React Native's version works fine. First video is the component from this library, second is from RN.

My component looks like:

 <SafeAreaView
      className="flex-1"
      edges={['bottom']}
    >
      <KeyboardAvoidingView
        behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
        keyboardVerticalOffset={headerHeight}
        className="flex-1 px-4"
      >
      ...
            <Input
              variant="rounded"
              size="xl"
            >
              <InputField
                autoFocus
                keyboardType="email-address"
                autoCapitalize="none"
                placeholder="kenji@lopez.alt"
                type="text"
                value={emailValue}
                onChangeText={setEmailValue}
              />
            </Input>
      ....
      </KeyboardAvoidingView>
    </SafeAreaView>
notworking.mp4
working.MP4

Metadata

Metadata

Assignees

Labels

KeyboardAvoidingView 🧪Anything related to KeyboardAvoidingView componentrepro providedIssue contains reproduction repository/code🐛 bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions