Skip to content

[Android] Closing a plain Modal briefly shows and hides the software keyboard #56745

@eduardoborges

Description

@eduardoborges

Description

On Android, closing a plain React Native Modal can briefly show and immediately hide the software keyboard, even when:

  • the modal does not contain any TextInput
  • no TextInput was focused before opening the modal
  • the app only uses React Native core components

This creates a visible keyboard flicker during modal dismissal.

The repro app also listens to keyboardDidShow and keyboardDidHide and prints recent keyboard events on screen, so the behavior can be confirmed even if the visual flicker is very fast.

Steps to reproduce

  1. Clone the repro:

    git clone https://github.com/eduardoborges/rn-modal-keyboard-flicker-repro.git
    cd rn-modal-keyboard-flicker-repro
  2. Install dependencies:

    npm install
  3. Start Metro:

    npm start
  4. Run the Android app:

    npm run android
  5. Tap Open plain RN Modal.

  6. Close the modal by tapping Close modal or the backdrop.

React Native Version

0.85.3

Affected Platforms

Runtime - Android

Areas

Modal, Keyboard, Android

Output of npx react-native info

System:
  OS: Linux 7.0 Arch Linux
  CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
  Memory: 8.75 GB / 31.25 GB
  Shell:
    version: "5.9"
    path: /usr/bin/zsh
Binaries:
  Node:
    version: 25.9.0
    path: /home/edu/.local/share/mise/installs/node/latest/bin/node
  Yarn: Not Found
  npm:
    version: 11.12.1
    path: /home/edu/.local/share/mise/installs/node/latest/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: AI-253.32098.37.2534.15336583
Languages:
  Java:
    version: 17.0.18
    path: /home/edu/.local/share/mise/installs/java/temurin-17/bin/javac
  Ruby:
    version: 3.4.1
    path: /home/edu/.local/share/mise/installs/ruby/3.4.1/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.0
    wanted: 20.1.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.85.3
    wanted: 0.85.3
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Device

Reproduced on a physical Android device:

Samsung SM-S938B
Android 16

The app was also installed on an Android emulator for comparison.

Reproducer

https://github.com/eduardoborges/rn-modal-keyboard-flicker-repro

Expected behavior

Closing a plain Modal should not show the software keyboard when there is no focused input and no TextInput inside the modal.

Actual behavior

The keyboard briefly appears and disappears while the modal is closing.

Notes

The repro uses a default React Native CLI project with android:windowSoftInputMode="adjustResize" in AndroidManifest.xml, which is the generated default.

The issue was originally noticed in a larger app using a custom bottom sheet component, but the standalone repro shows that the behavior is reproducible with a plain React Native Modal only.

Demo

Screen_Recording_20260509_111457_RnModalKeyboardRepro.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions