react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Navigating from screen with autoFocus input to previous screen with autoFocus input, error thrown

Open alexwasner opened this issue 4 years ago • 4 comments

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.

  1. Using React Navigation (might repro with other nav stacks too,) create 2 screens with text inputs and enable autoFocus on both
  2. Navigate from screen a, to screen b and then navigate back without dismissing the keyboard
  3. 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}
            ...
      />

ca8bae85b4ed8fce007b7744dd917e39

Doesn't error

       <TouchableOpacity>
            onPress={(): boolean => {
              Keyboard.dismiss();
              setTimeout(() => {
                navigation.goBack();
              }, 500);
            }
      }/>
      <Input
            autoCapitalize="none"
            autoFocus={true}
            value={value}
            ...
      />

508d9fd5d203acc9b13769b85c9b45b8

alexwasner avatar Sep 01 '20 19:09 alexwasner

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.

stale[bot] avatar Dec 25 '20 19:12 stale[bot]

same issue

zoobibackups avatar Jun 15 '21 07:06 zoobibackups

same issue

urtheone avatar Jul 09 '21 08:07 urtheone

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.

github-actions[bot] avatar Jul 07 '23 05:07 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jul 14 '23 05:07 github-actions[bot]