facebook / react-native

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

TextInput onPressOut prematurely triggers (iOS) #34551

Closed hufftheweevil closed 1 year ago

hufftheweevil commented 2 years ago

Description

The onPressOut event is triggered before the finger is removed from the TextInput. This occurs in iOS (tested on 15.16.1) and does not occur in Android.

It's possible this is caused by iOS offering the built-in "Scan Text" tooltip/menu.

Version

0.68.2

Output of npx react-native info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
    Memory: 18.28 GB / 31.81 GB
  Binaries:
    Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.14.17 - ~\<project-folder>\node_modules\.bin\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowAllTrustedApps: Disabled
      Versions: 10.0.17763.0, 10.0.19041.0
  IDEs:
    Android Studio: Version     2020.3.0.0 AI-203.7717.56.2031.7935034
    Visual Studio: Not Found
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.68.2 => 0.68.2
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

Create a component

<TextInput onPressIn={() => console.log('IN ', +new Date())} onPressOut={() => console.log('OUT', +new Date())}/>

On Android, when pressed in and out approximately 2 seconds apart:

IN  1661988080110
OUT 1661988082320

On iOS, the out is triggered within a few hundred seconds of in, even though the finger is still holding on the TextInput:

IN  1661988176404
OUT 1661988176615

Snack, code example, screenshot, or link to a repository

See above

github-actions[bot] commented 1 year ago

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] commented 1 year ago

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