React Native Picker component does not have an onTouch property

Description:

The current picker does not have any event listeners for onBlur, onTouch events. So it is impossible in the app to know if the user has interacted with the picker component. The only way to know if a user has made contact with the component is through the onValueChange property. However, if the user opens the picker on Android, but doesn’t select a value and/or closes the picker, the app cannot know if the user has interacted with the picker.

This is needed for form validations, to display warnings or error messages after the user has “touched” the picker component.

React Native version:
System:
OS: macOS 10.15.3
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 6.30 GB / 16.00 GB
Shell: 3.2.57 – /bin/bash
Binaries:
Node: 12.13.1 – /usr/local/bin/node
npm: 6.13.4 – /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.3.1/11C504 – /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native: 0.61.5

Steps To Reproduce

  1. Import Picker component from react-native library,
  2. Check the props of Picker component.

Expected Results

There should be a listener event of touch gestures or focus changes.

2 thoughts on “React Native Picker component does not have an onTouch property

Comments are closed.