You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove requestAnimationFrame when focusing input on mount (#27217)
Summary:
When using `react-native-screen` which uses native view controller animations for navigation `TextInput` with `autoFocus` causes a weird animation glitch.
Removing the requestAnimationFrame will cause the focus command to be sent in the same batch as starting screen transitions which fixes the issue.
It is unclear why the rAF was added in the first place as it was part of the initial RN open source commit. If someone at facebook has more context that would be great to make sure it doesn't cause unintended side effects.
Credits to kmagiera for figuring out this
## Changelog
[General] [Fixed] - Remove requestAnimationFrame when focusing input on mount
Pull Request resolved: #27217
Test Plan:
- Tested in an app using react-native-screen to make sure the animation glitch is fixed
- Tested in RNTester to make sure it doesn't cause other issues when not using react-native-screens
Before:

After:

Differential Revision: D18666991
Pulled By: TheSavior
fbshipit-source-id: 66664c89e06c9ae65074ddcc4688dc5109fc9c72
0 commit comments