Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyboardAwareScrollView jumps when the text is near the keyboard #613

Open
iphonic opened this issue Oct 1, 2024 · 3 comments
Open

KeyboardAwareScrollView jumps when the text is near the keyboard #613

iphonic opened this issue Oct 1, 2024 · 3 comments
Assignees
Labels
🐛 bug Something isn't working KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component

Comments

@iphonic
Copy link

iphonic commented Oct 1, 2024

ScrollView starts jumping to top and bottom when the KeyboardAwareScrollView starts acting to scroll up the TextInput

Basic code used

Styles

safeAreaView: {
    flex: 1
}

main: {
    flex: 1,
    marginBottom: 0,
}

contentContainer:{
    padding: 15,
    flexGrow: 1,
}

contentText:{
    flex: 1,
    fontSize: 16,
    minHeight: 60,
    textAlignVertical: 'top',
}

return <SafeAreaView style={styles.safeAreaView} edges={["top"]}>
      <View style={styles.main}>
        <KeyboardAwareScrollView>
          <View style={styles.contentContainer}>
            <TextInput
              style={styles.contentText}
              multiline
              value={message}
              onChangeText={(value) => setMessage(value)}
              scrollEnabled={false}
            />
          </View>
        </KeyboardAwareScrollView>
      </View>
</SafeAreaView>

ScreenRecording2024-10-02at1 01 13AM

  • MacOS 14.4.1
  • Device: iPhone 13 Simulator
  • OS: 17.4
  • RN version: 0.73.0
  • Library version: 1.14.0
@kirillzyusko
Copy link
Owner

Thanks @iphonic

I'll check it! I'm currently still sick, but will try to find some time for that 👀

@kirillzyusko kirillzyusko added KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component 🐛 bug Something isn't working labels Oct 7, 2024
@kirillzyusko
Copy link
Owner

@iphonic isn't it a bug in react-native itself? I removed "auto-scroll" functionality in KeyboardAwareScrollView and from what I see is that when text moves to a new line ScrollView suddenly scrolls to the top 🤯

ScreenRecording_12-30-2024.11-50-22.AM_1.MP4

I've tried to reproduce the bug with simple ScrollView and bug doesn't happen 🤔 Seems like it's a bug in reanimated - will try to prepare a reproduction example and open an issue 👀

@kirillzyusko
Copy link
Owner

Seems like a bug in react-native: facebook/react-native#48412

kirillzyusko added a commit that referenced this issue Jan 3, 2025
#751)

## 📜 Description

Added example where input takes full height of the screen. Such scenario
is quite common for messaging app (GMail for example).

## 💡 Motivation and Context

Will help to reproduce
#578
#512
#613

## 📢 Changelog

<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->

### JS

- added long `TextInput` to `AwareScrollView` example.

## 🤔 How Has This Been Tested?

Tested manually on:
- iPhone 15 Pro;
- Medium Phone API 35;

## 📸 Screenshots (if appropriate):

<img width="274" alt="image"
src="https://github.com/user-attachments/assets/d8bc6126-0435-4965-81e1-80edaf13f14f"
/>

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component
Projects
None yet
Development

No branches or pull requests

2 participants