react-native/Libraries
Jay Phelps baa61ddc9c Trigger onFocus/onBlur instead of onPressIn/onPressOut (eventually, but for now just deprecate) (#18470)
Summary:
Currently on iOS and Android focus/blur events trigger onPressIn/onPressOut. Based on discussions with people are several companies who use react-native we're proposing instead triggering new events onFocus/onBlur. Initial discussion on Slack with some from the core team on Slack seemed positive.

Couple reasons:

* The current API behavior overloads onPressIn/onPressOut. That means on platforms like react-native-web, if focus/blur support was added (as we're hoping for), even though onPressIn/onPressOut would be useful as the name describes, you wouldn't be able to distinguish between it and browser element focus/blur events.
* The names aren't as self-documenting/intuitive as onFocus/onBlur, especially for react-dom users.

There aren't any current tests around this, but I intend to add them if we solidify the API.

There's also an option question on the transition--do we deprecate the existing API with a warning? This PR just deprecates them, though it will on any TV platform when something becomes focused regardless of whether they use the API or not. This isn't ideal. It's not clear if there are alternatives or if just right away breaking the API for TV users is the correct solution, if we can get consensus between the few parties who are using it.

***

I'm interested to hear counter points or prior discussions.

Cc/ matthargett dlowder-salesforce rozele
Closes https://github.com/facebook/react-native/pull/18470

Differential Revision: D8368109

Pulled By: hramos

fbshipit-source-id: 22587b82e091645e748b6c2d721fdff06d54837f
2018-06-11 15:31:15 -07:00
..
ART Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
ActionSheetIOS deleted UI Action Sheet Delegate Methods 2018-05-30 10:40:39 -07:00
Alert Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Animated Enable Flow for bezier 2018-06-10 15:16:15 -07:00
AppState Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
BatchedBridge Remove __fbUninstallRNGlobalErrorHandler 2018-05-21 11:12:46 -07:00
Blob iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
BugReporting Fix some typos in dumpReactTree.js (#19636) 2018-06-09 20:27:42 -07:00
CameraRoll iOS: disable deprecation warning for Xcode 9.3.1+ for now 2018-05-22 01:16:45 -07:00
Color Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
Components Trigger onFocus/onBlur instead of onPressIn/onPressOut (eventually, but for now just deprecate) (#18470) 2018-06-11 15:31:15 -07:00
Core Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
EventEmitter Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Experimental Flowtype SwipeableRow 2018-05-14 00:24:44 -07:00
Geolocation iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
Image Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
Inspector Flowtype ListView 2018-05-14 00:24:44 -07:00
Interaction RN: Remove ReactPerf References 2018-05-15 13:16:57 -07:00
JSInspector Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
LayoutAnimation Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
Linking Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
LinkingIOS iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
Lists Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
Modal Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
NativeAnimation iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
Network iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
Performance QuickPerformanceLogger.js: markerPoint + iOS/Android JS binding 2018-06-08 08:32:05 -07:00
PermissionsAndroid Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
PushNotificationIOS iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
RCTTest RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
ReactNative Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
Renderer React sync for revisions de84d5c...c0fe8d6 2018-05-18 20:22:45 -07:00
Sample iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
Settings iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
Share Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Storage Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
StyleSheet Migrate PickerIOS to ES6 Class 2018-06-09 18:16:22 -07:00
SurfaceBackedComponent Update license headers for MIT license 2018-02-16 18:31:53 -08:00
SurfaceHostingComponent Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Text iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
Types Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
Utilities Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
Vibration iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
WebSocket Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
Wrapper Update additional license headers 2018-03-08 12:10:14 -08:00
fishhook Merge fishhook.xcodeproj in RCTWebSocket 2017-08-09 07:48:09 -07:00
polyfills Upgrade babel to beta.47 across xplat 2018-05-23 06:16:01 -07:00
react-native Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
vendor Add MIT License Header 2018-06-09 18:16:21 -07:00
.npmignore npmignore: ignore tests and fixtures 2018-02-27 08:42:14 -08:00
Promise.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
UTFSequence.js Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
promiseRejectionIsError.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00