react-native/Examples/UIExplorer/js
Maxime Lapointe d56530d7d5 Reworking keyboardShouldPersistTaps to have a middle ground
Summary:
Right now, the ScrollView's keyboard hiding behavior is either all or nothing: Hide the keyboard on any tap, or do nothing ever. This PR introduces a third mode to keyboardShouldPersistTaps which is much closer to what I consider should be the default.

In the new behavior, the tap responding is done in the bubbling phase (instead of the capture phase like =true). As a result, a child can handle the tap. If no child does, then the ScrollView will receive the tap and will hide the keyboard. As a result, changing TextInput focus works as a user expects, with a single tap and without keyboard hiding. But taping on Text or on the empty part of the ScrollView hides the keyboard and removes the focus.

You can view the behavior in a monkey patched ScrollView demo on rnplay:
https://rnplay.org/apps/E90UYw
https://rnplay.org/apps/UGzhKA

In order to have a uniform props set, i added 3 values to the keyboardShouldPersistTaps:
'never' and 'always' are the same as false and true.
'handled' is the new behavior.

I don't
Closes https://github.com/facebook/react-native/pull/10628

Differential Revision: D4294945

Pulled By: ericvicenti

fbshipit-source-id: 1a753014156cac1a23fabfa8e1faa9a768868ef2
2016-12-07 21:43:35 -08:00
..
AnimatedGratuitousApp Clean unused import modules. 2016-10-16 11:13:40 -07:00
NavigationExperimental Reverted commit D4027388 2016-10-16 04:13:42 -07:00
Navigator Kill require('image!...') 2016-11-22 21:13:52 -08:00
Thumbnails Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
AccessibilityAndroidExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
AccessibilityIOSExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
ActionSheetIOSExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
ActivityIndicatorExample.js ActivityIndicator Example ES6 classes migration and TimerMixin removal 2016-08-02 17:13:30 -07:00
AdSupportIOSExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
AlertExample.js Android: Implement cancelable option for Alerts 2016-08-09 06:13:48 -07:00
AlertIOSExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
AnimatedExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
AppStateExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
AssetScaledImageExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
AsyncStorageExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
BorderExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
BoxShadowExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ButtonExample.js Add disabled prop 2016-10-14 19:43:40 -07:00
CameraRollExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
CameraRollView.js Throw flow error when trying to access a style that is not defined on a stylesheet 2016-07-18 23:28:25 -07:00
ClipboardExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
DatePickerAndroidExample.js Android datepicker mode configurations added 2016-11-23 04:58:31 -08:00
DatePickerIOSExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
ExampleTypes.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
GeolocationExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
ImageCapInsetsExample.js Kill require('image!...') 2016-11-22 21:13:52 -08:00
ImageEditingExample.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
ImageExample.js Cleanup before image! codemod 2016-11-22 21:13:52 -08:00
KeyboardAvoidingViewExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
LayoutAnimationExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
LayoutEventsExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
LayoutExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
LinkingExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ListViewExample.js Fix minor typo in ListViewExample.js 2016-07-18 10:30:53 -07:00
ListViewGridLayoutExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ListViewPagingExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
MapViewExample.js Add in UI Explorer example for showing annotation callouts by default in <MapView> 2016-12-01 08:58:34 -08:00
ModalExample.js Fix ModalExample flex issue with Button 2016-10-28 05:43:35 -07:00
NativeAnimationsExample.js Add support for native animated events on iOS 2016-11-01 03:58:53 -07:00
NavigatorIOSColorsExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
NavigatorIOSExample.js Kill require('image!...') 2016-11-22 21:13:52 -08:00
NetInfoExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
OrientationChangeExample.js Listen to device orientation changes 2016-09-06 03:59:01 -07:00
PanResponderExample.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
PermissionsExampleAndroid.android.js Handle "Never Ask Again" in permissions and add requestMultiplePermissions 2016-11-24 22:43:28 -08:00
PickerExample.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
PickerIOSExample.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
PointerEventsExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ProgressBarAndroidExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ProgressViewIOSExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
PushNotificationIOSExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
RCTRootViewIOSExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
RTLExample.js Add viewConfig to RCTSlider Component, fix #10158 2016-10-12 08:59:05 -07:00
RefreshControlExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
RootViewSizeFlexibilityExampleApp.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ScrollViewExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ScrollViewSimpleExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
SegmentedControlIOSExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
SetPropertiesExampleApp.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ShareExample.js Add Share module 2016-07-25 03:43:29 -07:00
SliderExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
SnapshotExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
StatusBarExample.js Add currentHeight constant to status bar docs 2016-11-05 17:13:29 -07:00
SwipeableListViewExample.js Remove react-native.js.flow 2016-09-14 02:58:40 -07:00
SwitchExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
TabBarIOSExample.js unselectedItemTintColor property available since iOS10 2016-11-29 12:28:55 -08:00
TextExample.android.js <Text> Expose Android's includeFontPadding property to JavaScript. 2016-12-02 12:58:36 -08:00
TextExample.ios.js Added support of `<Text>`'s `selectable` attribute on iOS 2016-11-17 16:13:28 -08:00
TextInputExample.android.js Cleanup: Prefer `React.Element` over `React$?Element` 2016-10-14 08:59:37 -07:00
TextInputExample.ios.js RN TextInput: don't let user more than maxLength when TextInput already exceeds it 2016-10-18 08:13:41 -07:00
TimePickerAndroidExample.js FIX #9939 - Add missing options argument to Android picker example 2016-09-16 00:43:30 -07:00
TimerExample.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
ToastAndroidExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ToolbarAndroidExample.android.js Kill require('image!...') 2016-11-22 21:13:52 -08:00
TouchableExample.js Fix for TouchableNativeFeedback having Animated.Component direct child 2016-10-25 00:28:37 -07:00
TransformExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
TransparentHitTestExample.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
UIExplorerActions.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
UIExplorerApp.android.js Kill require('image!...') 2016-11-22 21:13:52 -08:00
UIExplorerApp.ios.js Reverted commit D4027388 2016-10-16 04:13:42 -07:00
UIExplorerBlock.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
UIExplorerButton.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
UIExplorerExampleContainer.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
UIExplorerExampleList.js Reworking keyboardShouldPersistTaps to have a middle ground 2016-12-07 21:43:35 -08:00
UIExplorerList.android.js Introduce Button Component 2016-10-10 17:28:39 -07:00
UIExplorerList.ios.js Introduce Button Component 2016-10-10 17:28:39 -07:00
UIExplorerNavigationReducer.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
UIExplorerPage.js Reworking keyboardShouldPersistTaps to have a middle ground 2016-12-07 21:43:35 -08:00
UIExplorerSettingSwitchRow.js Add some stall stuff as settings to native animated example 2016-09-06 19:58:35 -07:00
UIExplorerStatePersister.js Deploy v0.35.0 2016-11-14 20:45:17 -08:00
UIExplorerStateTitleMap.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
UIExplorerTitle.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
URIActionMap.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
VibrationExample.js Ios: complete iOS vibration pattern supports (js) 2016-08-25 18:28:38 -07:00
VibrationIOSExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ViewExample.js Reinstate view example for screenshot tests 2016-08-16 04:58:30 -07:00
ViewPagerAndroidExample.android.js Modify image url from http to https on examples 2016-11-03 08:13:37 -07:00
WebSocketExample.js Android WebSocket: include cookies in request 2016-11-07 10:43:44 -08:00
WebViewExample.js Implement a postMessage function and an onMessage event for webviews … 2016-10-16 06:43:46 -07:00
XHRExample.android.js Add responseType as a concept to RCTNetworking, send binary data as base64 2016-07-13 04:58:37 -07:00
XHRExample.ios.js Support RCTNetworking#clearCookies on iOS 2016-08-26 05:43:39 -07:00
XHRExampleCookies.js Add responseType as a concept to RCTNetworking, send binary data as base64 2016-07-13 04:58:37 -07:00
XHRExampleFetch.js Update XHRExampleFetch and dump the response headers 2016-09-06 04:28:38 -07:00
XHRExampleHeaders.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
XHRExampleOnTimeOut.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
bunny.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
createExamplePage.js Clean unused import modules. 2016-10-16 11:13:40 -07:00
flux@3x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
hawk.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
helloworld.html Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
http_test_server.js Android WebSocket: include cookies in request 2016-11-07 10:43:44 -08:00
messagingtest.html Implement a postMessage function and an onMessage event for webviews … 2016-10-16 06:43:46 -07:00
relay@3x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider-left.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider-left@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider-right.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider-right@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_comment_highlighted@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_comment_normal@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_thumb_big.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_thumb_normal@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_thumb_selected@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
websocket_test_server.js Android WebSocket: include cookies in request 2016-11-07 10:43:44 -08:00