Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextInput loses focus when clicked after navigating through a Material Top Tab Navigator and then through a Stack Navigator #10870

Open
4 of 12 tasks
kmgalanakis opened this issue Sep 21, 2022 · 5 comments

Comments

@kmgalanakis
Copy link

kmgalanakis commented Sep 21, 2022

Current behavior

Imagine an app with a structure as follows:

  • On top, there is a Material Tabs Navigator with three tabs.
  • The first and the last tabs lead to a screen while the middle tab leads to a Stack Navigator containing two screens.
  • Clicking the middle tab brings the user to the first Stack screen where there is some text and a button.
  • Clicking that button brings the user to the second Stack screen.
  • This second Stack screen contains a TextInput, which instantly loses focus when clicked loses focus instantly but only for the first time.

Expected behavior

I would expect the TextInput to remain focused until the user clicks somewhere outside of it.

Reproduction

https://snack.expo.dev/@konstantinos.g/material-top-tab-navigator-bug

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/​bottom-tabs
  • @react-navigation/​drawer
  • @react-navigation/​material-bottom-tabs
  • @react-navigation/​material-top-tabs
  • @react-navigation/​stack
  • @react-navigation/​native-stack

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native 6.0.13
@react-navigation/material-top-tabs 6.2.4
@react-navigation/stack 6.3.1
react-native-screens 3.15.0
react-native-gesture-handler 2.5.0
react-native-tab-view 3.0.0
react-native-pager-view 5.4.24
@github-actions
Copy link

Couldn't find version numbers for the following packages in the issue:

  • @react-navigation/native
  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-bottom-tabs
  • @react-navigation/material-top-tabs
  • @react-navigation/stack

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

@github-actions
Copy link

Couldn't find version numbers for the following packages in the issue:

  • @react-navigation/native
  • @react-navigation/material-top-tabs
  • @react-navigation/stack

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

@tienifr
Copy link

tienifr commented Sep 6, 2023

@kmgalanakis Do you know how to fix this?

@kmgalanakis
Copy link
Author

@kmgalanakis Do you know how to fix this?

I'm no longer interested in investing time to figure out how to fix it, sorry

@milos291
Copy link

Set
screenOptions={{
animationEnabled: false,
}},
and it will no longer lose focus, provided that animation is not important to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants