Skip to content

[iOS] Keyboard goes outside screen bounds when navigation back via navigation.goBack() #3849

@zohayk

Description

@zohayk

Description

When navigating back via navigation.goBack() from a custom back button, the keyboard goes outside the screen bounds during the transition.

However, when navigating back using the native header back button, the keyboard stays within the screen bounds and behaves correctly.

Expected behavior: The keyboard should stay within the screen bounds when going back via navigation.goBack(), same as when using the native header back button.

Current behavior: The keyboard visually exits the screen frame when going back via navigation.goBack().

Screenshot 1

This behavior occurs when navigating back via navigation.goBack().

Image

Screenshot 2

This behavior does NOT occur when navigating back via the native header back button.

Image

Video

Screen.Recording.mov

This issue occurs in both React Native and Expo, across all versions.

Steps to reproduce

  1. Open a screen that has a TextInput
  2. Tap on the TextInput so the keyboard appears
  3. Tap the custom back button that calls navigation.goBack()
  4. The keyboard goes outside the screen bounds during the transition

Snack or a link to a repository

https://snack.expo.dev/@zo_hayk/keyboard-goes-outside-screen

Environment

package version
@react-navigation/native 7.2.1
@react-navigation/native-stack 7.14.9
@react-navigation/stack 7.8.8
react 19.2.3
react-native-screens 4.24.0
react-native 0.84.1
react-native-safe-area-context 5.7.0

Screens version

4.24.0

React Native version

0.84.1

Platforms

iOS

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:iosIssue related to iOS part of the libraryrepro-providedA reproduction with a snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions