KeyboardAvoidingView not working after migrating from Expo SDK 52 to SDK 53 #167709
Discussion TypeQuestion Discussion ContentAfter upgrading my project from Expo SDK 52 to SDK 53, KeyboardAvoidingView no longer behaves as expected. |
Replies: 4 comments 4 replies
|
Hi! 👋
If that doesn’t help, could you share a small code snippet? I’d be happy to take a look. |
|
This is due to Expo SDK 53 enabling edge-to-edge display by default, which changes how safe areas and system insets (status bar, navigation bar, keyboard) are handled. function MyScreen() { return ( |
|
I upgraded from SDK 53 to SDK 54 and I had to fix like this and it is working. |
|
i'm having big issues on Android. |
This is due to Expo SDK 53 enabling edge-to-edge display by default, which changes how safe areas and system insets (status bar, navigation bar, keyboard) are handled.
Solution might be to wrap your view in SafeAreaProvider and use useSafeAreaInsets
https://expo.dev/blog/edge-to-edge-display-now-streamlined-for-android
`
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
import { KeyboardAvoidingView, Platform, View } from 'react-native';
function MyScreen() {
const insets = useSafeAreaInsets();
return (
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
style={{ flex: 1 }}
>
<View style={{
flex: 1,
paddingBottom: insets.bottom,
…