Skip to content

KeyboardAwareScrollView on android is not as smooth as ios #719

@caothuyen

Description

@caothuyen

Describe the bug
When the keyboard opens, the content below is pushed up, not as smoothly as on iOS.

Code snippet

function LoginScreen() {
  return (
    <View style={styles.container}>
      <View style={styles.background}>
        <LinearGradient
          colors={["#114395", "#195DCE", "#1F6BF2", "#0A89E2", "#fff"]}
          locations={[0, 0.135, 0.36, 0.45, 0.625]}
          style={[styles.background, styles.backgroundLinear]}
        />
        <LogoLine style={[styles.logoLine, styles.background]} />
        <NetworkLine style={[styles.networkLine, styles.background]} />
      </View>

      <KeyboardAwareScrollView style={styles.scrollView} showsVerticalScrollIndicator={false}>
        <View style={styles.content}>
          <Image source={require("assets/images/icon.png")} style={styles.logo} fadeDuration={0} />
          <Text style={styles.title}>Chào mừng đến với Quốc Duy</Text>
          <RenderForm />
          <TextInput style={{ height: 48, borderWidth: 1, borderColor: "red" }} placeholder="press input" />
          <TextInput style={{ height: 48, borderWidth: 1, borderColor: "red" }} placeholder="press input" />
          <TextInput style={{ height: 48, borderWidth: 1, borderColor: "red" }} placeholder="press input" />
        </View>
      </KeyboardAwareScrollView>
    </View>
  );
}

Expected behavior
On android can be as smooth as ios

Screenshots

Screen.Recording.2024-12-04.at.09.46.42.mov
Screen.Recording.2024-12-04.at.09.47.07.mov

I tested on real device and production environment but still not effective

  • Desktop OS: MacOS 15.1.1
  • Device: iPhone 14 Pro Max and Android pixel 6 pro
  • OS: iOS 17.5 and android 12
  • RN version: 0.76.3
  • RN architecture: paper/fabric
  • JS engine: Hermes
  • Library version: 1.14.5

Metadata

Metadata

Assignees

Labels

KeyboardAwareScrollView 📜Anything related to KeyboardAwareScrollView componentrepro providedIssue contains reproduction repository/code🤖 androidAndroid specific

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions