facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.29k stars 24.35k forks source link

Screen jumps when secureTextEntry is set and the keyboard suggests passwords before focusing on the input with secureTextEntry prop #47106

Open avega99 opened 1 month ago

avega99 commented 1 month ago

Description

The screen jumps when one of the inputs has the secureTextEntry prop because the keyboard suggests passwords even when typing in a different input that doesn’t have secureTextEntry prop. This happens when focusing on an input placed before the one with secureTextEntry, and as you type, the password suggestion appears and disappears, causing the screen to jump.

https://github.com/user-attachments/assets/14403cee-3d9c-4951-855e-7591f18c4fb8

Steps to reproduce

As you can see in the code, username input doesn't have sceureTextEntry prop set and still suggests passwords above the keyboard, this suggestion appears and disappears as you type causing the app to jump, this only happens when focusing the input just before the one that has the secureTextProp set to true.

`export default function HomeScreen() { const passRef = useRef(null) const usernameRef = useRef(null)

return (

Header usernameRef.current?.focus()} style={styles.textInput} /> passRef.current?.focus()} style={styles.textInput} />
react-native-bot commented 1 month ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.74.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
react-native-bot commented 1 month ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.