Closed
Description
Description
When a KeyboardAvoidingView is wrapped around a ScrollView with behavior="height"
and the scrollview has contents that has a scrollable height > device height, focussing a text input will freeze app on ios, I cannot test on android at the moment so can only confirm the issue on iOS.
React Native version:
System:
OS: macOS 11.0.1
CPU: (8) x64 VirtualApple @ 2.50GHz processor
Memory: 119.02 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.1 - /var/folders/wr/9smsws7s7fz53bs2905q080h0000gn/T/yarn--1606680389084-0.9742257659131075/node
Yarn: 1.22.10 - /var/folders/wr/9smsws7s7fz53bs2905q080h0000gn/T/yarn--1606680389084-0.9742257659131075/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.0 - /Users/oliverwinter/.rvm/gems/ruby-2.6.1/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK:
API Levels: 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6953283
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_275 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0-rc.0 => 0.64.0-rc.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
The following snippet can be used to replicate the issue.
import React from 'react';
import {
KeyboardAvoidingView,
SafeAreaView,
ScrollView,
TextInput,
View,
} from 'react-native';
const App = () => {
return (
<SafeAreaView>
<KeyboardAvoidingView behavior="height">
<ScrollView>
<TextInput
placeholder="Placeholder text"
style={{height: 50, fontSize: 20}}
/>
<View style={{height: 2000, backgroundColor: 'red'}} />
</ScrollView>
</KeyboardAvoidingView>
</SafeAreaView>
);
};
export default App;