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

returnkeytype do not work immediately #46031

Closed
wqhui opened this issue Aug 15, 2024 · 3 comments
Closed

returnkeytype do not work immediately #46031

wqhui opened this issue Aug 15, 2024 · 3 comments

Comments

@wqhui
Copy link

wqhui commented Aug 15, 2024

Description

I use a TextInput and modify returnKeyType when it has a value, but I found that it does not take effect in real time.

        <TextInput
          autoCorrect={false}
          multiline
          onChangeText={setText}
          value={text}
          placeholder={'type text...'}
          keyboardAppearance={'light'}
          returnKeyType={text.length ? 'send' : 'default'}
          onSubmitEditing={text.length ? onKeyboardSend : undefined}
        />

I found that the confirmation button on the keyboard has actually taken effect(it means onKeyboardSend will be exec when i click confirmation button in keyboard), but the text on the confirmation button has not changed. I have to wait until blur and reopen the keyboard the text of the confirmation button can be modified.

Steps to reproduce

  1. using my code
  2. typing text in textinput
  3. watching keybord

React Native Version

0.70.4

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1
    Memory: 91.14 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.8.0 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 7.21.0 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.15.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 15.0.1/15A507 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0 
    react-native: 0.70.4 => 0.70.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Stacktrace or Logs

none

Reproducer

https://snack.expo.dev/@wuyiii/returnkeytype-do-not-work-immediately?platform=ios

Screenshots and Videos

  1. typing...
image
  1. blur and reopen keyboard same input
image
@react-native-bot
Copy link
Collaborator

⚠️ Too Old Version of React Native
ℹ️ It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

@react-native-bot
Copy link
Collaborator

⚠️ Too Old Version of React Native
ℹ️ It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

@wqhui
Copy link
Author

wqhui commented Aug 15, 2024

⚠️ Too Old Version of React Native
ℹ️ It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

in expo snack, the Least Version of React Native has same problem

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

2 participants