IssueRaiser

KeyboardAvoidingView Leaves Extra Bottom Padding After Keyboard Closes

### Description ### **Description** When using KeyboardAvoidingView with behavior="height" on Android in combination with SafeAreaView and useSafeAreaInsets(), remains even after the keyboard closes, leaving an unexpected gap at the bottom of the screen. This issue is more visible on Android devices without soft navigation buttons. This behavior is inconsistent with iOS, where the padding collapses as expected. **Expected Behavior** When the keyboard closes, the layout should return to its original state, removing any bottom padding unless explicitly added by the developer. **Actual Behavior** After the keyboard closes on Android, an extra bottom padding remains on the screen, pushing up content unnecessarily. Removing paddingBottom: insets.bottom fixes it, but this breaks devices with safe area (iOS or gesture nav Android) where insets are needed. ### Steps to reproduce ### **Steps To Reproduce** 1. Create a SafeAreaView wrapping a KeyboardAvoidingView (behavior="height"). 2. Inside, render a FlatList and an input box pinned to the bottom. 3. Open keyboard → input shifts correctly. 4. Close keyboard → padding remains, leaving gap at bottom. `<SafeAreaView style={{flex: 1}}> <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'} style={{ flex: 1, paddingTop: insets.top, }}> <View style={[ {flex: 1}, theme == 'dark' ? {backgroundColor: App

Posted by ChinmayLale on Jul 15, 2025, 8:33 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

github (SaaS)

KeyboardAvoidingView Leaves Extra Bottom Padding After Keyboard Closes

ChinmayLaleJul 15, 2025, 8:33 AM

### Description ### **Description** When using KeyboardAvoidingView with behavior="height" on Android in combination with SafeAreaView and useSafeAreaInsets(), remains even after the keyboard closes, leaving an unexpected gap at the bottom of the screen. This issue is more visible on Android devices without soft navigation buttons. This behavior is inconsistent with iOS, where the padding collapses as expected. **Expected Behavior** When the keyboard closes, the layout should return to its original state, removing any bottom padding unless explicitly added by the developer. **Actual Behavior** After the keyboard closes on Android, an extra bottom padding remains on the screen, pushing up content unnecessarily. Removing paddingBottom: insets.bottom fixes it, but this breaks devices with safe area (iOS or gesture nav Android) where insets are needed. ### Steps to reproduce ### **Steps To Reproduce** 1. Create a SafeAreaView wrapping a KeyboardAvoidingView (behavior="height"). 2. Inside, render a FlatList and an input box pinned to the bottom. 3. Open keyboard → input shifts correctly. 4. Close keyboard → padding remains, leaving gap at bottom. `<SafeAreaView style={{flex: 1}}> <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'} style={{ flex: 1, paddingTop: insets.top, }}> <View style={[ {flex: 1}, theme == 'dark' ? {backgroundColor: App

Comments (0)

No comments yet. Start the discussion.

Comment on this issue