Skip to content

Blank space upon closing the keyboard on few android versions #1091

@vineelk8

Description

@vineelk8

Describe the bug
I have upgraded my project to support Android 15 SDK. After the upgrade, we are facing multiple issues with the keyboard opening and closing. Below are the details for the issue

Code snippet
Here is the complete code to reproduce it

import React from 'react';
import { StyleSheet, Text, TextInput, View } from 'react-native';
import {
  KeyboardAwareScrollView,
  KeyboardStickyView,
} from 'react-native-keyboard-controller';

const SmapleScreen = () => {
  return (
    <View style={styles.container}>
      <View style={styles.header}>
        <Text style={styles.headerText}>Comments List</Text>
      </View>
      <KeyboardAwareScrollView contentContainerStyle={{ paddingBottom: 100 }}>
        {Array.from({ length: 20 }).map((_, i) => {
          return (
            <View key={String(i)} style={styles.commentBox}>
              <Text style={{ color: 'black' }}>{`Comment ${i}`}</Text>
            </View>
          );
        })}
      </KeyboardAwareScrollView>
      <KeyboardStickyView offset={200} style={styles.inputWrapper}>
        <TextInput
          placeholder="Write a reply..."
          style={styles.input}
          multiline
        />
      </KeyboardStickyView>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fafafa',
  },
  header: {
    padding: 16,
    backgroundColor: '#fff',
    borderBottomWidth: 1,
    borderBottomColor: '#ddd',
  },
  headerText: {
    fontSize: 16,
    fontWeight: '600',
  },
  commentBox: {
    padding: 16,
    borderBottomWidth: 1,
    borderBottomColor: '#eee',
    backgroundColor: '#fff',
  },
  inputWrapper: {
    bottom: 45,
    backgroundColor: '#fff',
    padding: 10,
    borderTopWidth: 1,
    borderColor: '#ddd',
  },
  input: {
    height: 45,
    borderWidth: 1,
    borderRadius: 8,
    borderColor: '#ccc',
    paddingHorizontal: 10,
    backgroundColor: '#fff',
  },
});

export default SmapleScreen;

To Reproduce
Steps to reproduce the behavior:

  • Project should support Android 15 (35)
  • Use the library versions as mentioned below in the project
  • Wrap the navigation in App.js as below
import React from 'react';
import { KeyboardProvider } from 'react-native-keyboard-controller';
import { NotifierWrapper } from 'react-native-notifier';

import AppNavigator from './src/navigation/AppNavigator';

const App = () => {
  return (
    <NotifierWrapper>
      <KeyboardProvider>
        <SafeAreaProvider initialMetrics={initialWindowMetrics}>
          <AppNavigator />
        </SafeAreaProvider>
      </KeyboardProvider>
    </NotifierWrapper>
  );
};

export default App;

  • Create a screen with the above shared code
  • Click inside the text input, the keyboard opens, then close it manually upon touching anywhere on the screen. Now the blank space is visible as shown in the recording. The blank space will be visible till the app is reopened

Expected behavior
On the keyboard, opening and closing the screen should adjust back to the normal position without any blank space

Screenshots
Here is the recording for the issue

Record_2025-08-20-12-56-16.mp4

Smartphone (please complete the following information):

  • Device: OnePlus Nord2 5G
  • OS: Android 13 (OxygenOS)
  • RN version: 0.74.6
  • Library versions:
    "react": "18.2.0",
    "react-native": "0.74.6",
    "react-native-edge-to-edge": "^1.6.2",
    "react-native-safe-area-context": "^5.5.2",
    "react-native-keyboard-controller": "^1.18.5",
    "react-native-notifier": "^2.0.0"

Metadata

Metadata

Assignees

Labels

repro providedIssue contains reproduction repository/code🐛 bugSomething isn't working🤖 androidAndroid specific

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions