react-native
react-native copied to clipboard
Navigating from screen with autoFocus input to previous screen with autoFocus input, error thrown
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
Navigating with React Navigation from ScreenB to previous ScreenA when both have an autoFocus
TextInput
on screen, the error 'focusTextInput must be called with a host component. Passing a react tag is deprecated.'
is thrown.
React Native version:
System:
OS: macOS 10.15.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 181.67 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.12.0 - ~/.asdf/installs/nodejs/13.12.0/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - ~/.asdf/installs/nodejs/13.12.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK: Not Found
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.6/11E708 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_232 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.0-rc.1
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- Using React Navigation (might repro with other nav stacks too,) create 2 screens with text inputs and enable
autoFocus
on both - Navigate from screen a, to screen b and then navigate back without dismissing the keyboard
- See error
Expected Results
Does not error when navigating back
Snack, code example, screenshot, or link to a repository:
Throws error
<TouchableOpacity>
onPress={(): boolean => {
navigation.goBack();
}
}/>
<Input
autoCapitalize="none"
autoFocus={true}
value={value}
...
/>
Doesn't error
<TouchableOpacity>
onPress={(): boolean => {
Keyboard.dismiss();
setTimeout(() => {
navigation.goBack();
}, 500);
}
}/>
<Input
autoCapitalize="none"
autoFocus={true}
value={value}
...
/>
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
same issue
same issue
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.