react-native-macos/React/Views
Antti Moilanen 72e203bf95 Fix ScrollView's snap index when scrolling forward and user taps the screen again while still scrolling
Summary:
Currently when snapping is used with ScrollView it calculates wrong snap index if user taps the screen second time while ScrollView is still scrolling. This happens because the code only adds 1 to the snap index when translationAlongAxis is smaller than zero. When user taps screen second time the translationAlongAxis is 0 and snap index ends up being one less than it should. This causes the ScrollView to scroll one step backwards.

Bug can be reproduced with the new examples I added to UIExplorer's ScrollView in [scrollview-snap-bug-example branch](https://github.com/anttimo/react-native/tree/scrollview-snap-bug-example).

Fix can be verified by running the same examples with the ScrollView fix in [scrollview-snap-bug-example-with-fix branch](https://github.com/anttimo/react-native/tree/scrollview-snap-bug-example-with-fix).

![scrollview-bug](https://cloud.githubusercontent.com/assets/150881/14427555/10d59d1e-fffe-11
Closes https://github.com/facebook/react-native/pull/6906

Differential Revision: D3927123

Pulled By: majak

fbshipit-source-id: 38828cc60a02a754bdc3ec72fb98d8777917f15e
2016-09-26 16:14:10 -07:00
..
RCTActivityIndicatorView.h Fixes ActivityIndicatorIOS doesn't hide initially 2016-06-27 17:13:27 -07:00
RCTActivityIndicatorView.m Fixes ActivityIndicatorIOS doesn't hide initially 2016-06-27 17:13:27 -07:00
RCTActivityIndicatorViewManager.h Improved RCTActivityIndicatorView and fixed some flow errors 2015-04-26 02:17:13 -08:00
RCTActivityIndicatorViewManager.m Fixes ActivityIndicatorIOS doesn't hide initially 2016-06-27 17:13:27 -07:00
RCTAnimationType.h [LayoutAnimation] RCTAnimationTypeKeyboard 2015-06-25 09:17:01 -08:00
RCTAutoInsetsProtocol.h Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -08:00
RCTBorderDrawing.h Support dashed and dotted border styles on iOS 2015-12-23 10:07:28 -08:00
RCTBorderDrawing.m Fixed border smearing issue 2016-01-07 12:03:17 -08:00
RCTBorderStyle.h Add property mapping for `borderStyle` from JS to `RCTView` (iOS) 2015-12-01 09:00:28 -08:00
RCTComponent.h Test building with clang 3.9 2016-08-10 13:13:34 -07:00
RCTComponentData.h Removed eager init of all ViewManagers on layout 2016-02-26 08:18:34 -08:00
RCTComponentData.m Export native modules without RCT or RK prefix 2016-09-23 11:14:11 -07:00
RCTConvert+CoreLocation.h [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+CoreLocation.m [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+MapKit.h Added ability to use a custom view for MapView annotations 2015-12-17 06:46:33 -08:00
RCTConvert+MapKit.m Implement draggable annotations on MapView. Closes #2512 2016-01-04 06:38:30 -08:00
RCTDatePicker.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTDatePicker.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTDatePickerManager.h Removed deprecated RCT_EXPORT + code paths 2015-06-05 09:58:25 -08:00
RCTDatePickerManager.m Removed exported constants for fixed-size views 2016-04-26 04:21:39 -07:00
RCTFont.h Add iOS support for CSS property font-variant, accepting tabular-nums… 2016-08-09 08:43:34 -07:00
RCTFont.mm Add iOS support for CSS property font-variant, accepting tabular-nums… 2016-08-09 08:43:34 -07:00
RCTMap.h Add MapView annotation callback when it gets / lost the focus 2016-01-29 06:26:30 -08:00
RCTMap.m Automated changes to remove implicit capture of self in blocks: Libraries/FBReactKit/BUCK 2016-07-07 12:44:14 -07:00
RCTMapAnnotation.h Cleanup warnings 2016-07-12 05:59:12 -07:00
RCTMapAnnotation.m Add Polyline support to MapView 2015-11-26 08:54:16 -08:00
RCTMapManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTMapManager.m Don't allow unsetting a region in RCTMapView 2016-08-16 10:59:03 -07:00
RCTMapOverlay.h Add Polyline support to MapView 2015-11-26 08:54:16 -08:00
RCTMapOverlay.m Add Polyline support to MapView 2015-11-26 08:54:16 -08:00
RCTModalHostView.h Allow <Modal /> to be presented in different orientations 2016-09-07 13:10:11 -07:00
RCTModalHostView.m Fix Modal to handle in-call status bar 2016-09-26 15:58:29 -07:00
RCTModalHostViewController.h Allow <Modal /> to be presented in different orientations 2016-09-07 13:10:11 -07:00
RCTModalHostViewController.m Warn when displaying a modal with unsupported interface orientations 2016-09-22 12:58:33 -07:00
RCTModalHostViewManager.h Allow <Modal /> to be configured with a custom presentation/dismissal block 2016-08-23 16:58:41 -07:00
RCTModalHostViewManager.m Allow <Modal /> to be presented in different orientations 2016-09-07 13:10:11 -07:00
RCTNavItem.h NavigatorIOS System Icon Support 2016-09-08 17:58:50 -07:00
RCTNavItem.m NavigatorIOS System Icon Support 2016-09-08 17:58:50 -07:00
RCTNavItemManager.h NavigatorIOS System Icon Support 2016-09-08 17:58:50 -07:00
RCTNavItemManager.m NavigatorIOS System Icon Support 2016-09-08 17:58:50 -07:00
RCTNavigator.h NavigatorIOS: Expose interactivePopGestureEnabled property 2016-05-06 03:18:20 -07:00
RCTNavigator.m fix typo 2016-08-24 08:29:00 -07:00
RCTNavigatorManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTNavigatorManager.m NavigatorIOS: Expose interactivePopGestureEnabled property 2016-05-06 03:18:20 -07:00
RCTPicker.h Added support for styling the PickerIOS 2015-12-08 07:48:26 -08:00
RCTPicker.m Added support for styling the PickerIOS 2015-12-08 07:48:26 -08:00
RCTPickerManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTPickerManager.m Improve types in RCTFont API 2016-08-05 12:44:21 -07:00
RCTPointerEvents.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTProgressViewManager.h Added ProgressViewIOS 2015-06-03 09:49:35 -08:00
RCTProgressViewManager.m Removed exported constants for fixed-size views 2016-04-26 04:21:39 -07:00
RCTRefreshControl.h Cross platform PullToRefreshView component 2016-01-04 08:00:29 -08:00
RCTRefreshControl.m RefreshControl Position Bug 2016-09-04 01:43:38 -07:00
RCTRefreshControlManager.h Cross platform PullToRefreshView component 2016-01-04 08:00:29 -08:00
RCTRefreshControlManager.m Allow to set refresh control title color 2016-04-16 15:15:25 -07:00
RCTRootShadowView.h Extracted rootview-specific shadowview logic into new class 2016-03-21 03:21:27 -07:00
RCTRootShadowView.m Revamp API 2016-07-20 08:58:59 -07:00
RCTScrollView.h Remove deprecated PullToRefreshViewAndroid and onRefreshStart / endRefreshing 2016-05-24 03:28:25 -07:00
RCTScrollView.m Fix ScrollView's snap index when scrolling forward and user taps the screen again while still scrolling 2016-09-26 16:14:10 -07:00
RCTScrollViewManager.h Remove scrollview support from UIManager, remove mainScrollView(delegate) 2015-11-25 04:12:34 -08:00
RCTScrollViewManager.m BREAKING - Fix unconstraint sizing in main axis 2016-09-26 06:13:56 -07:00
RCTScrollableProtocol.h Remove deprecated nativeScrollDelegate property 2016-07-11 13:34:02 -07:00
RCTSegmentedControl.h Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
RCTSegmentedControl.m Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
RCTSegmentedControlManager.h Add SegmentedControlIOS 2015-04-29 08:08:45 -08:00
RCTSegmentedControlManager.m Removed exported constants for fixed-size views 2016-04-26 04:21:39 -07:00
RCTShadowView.h Include CSSLayout.h consistently with other project includes 2016-09-06 09:13:39 -07:00
RCTShadowView.m Expose flexGrow, flexShrink, and flexBasis properties 2016-08-30 03:13:39 -07:00
RCTSlider.h Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
RCTSlider.m Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
RCTSliderManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSliderManager.m Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
RCTSwitch.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSwitch.m [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSwitchManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSwitchManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBar.h Enable setting color of text and images on unselected tabs 2016-05-03 05:40:29 -07:00
RCTTabBar.m Automated changes to remove implicit capture of self in blocks: Libraries/FBReactKit/BUCK 2016-07-07 12:44:14 -07:00
RCTTabBarItem.h Add renderAsOriginal to selectedIcon 2016-05-24 01:58:23 -07:00
RCTTabBarItem.m Add renderAsOriginal to selectedIcon 2016-05-24 01:58:23 -07:00
RCTTabBarItemManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTTabBarItemManager.m Add renderAsOriginal to selectedIcon 2016-05-24 01:58:23 -07:00
RCTTabBarManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTTabBarManager.m TabBarIOS itemPositioning - Fixes #4136 2016-05-20 17:28:50 -07:00
RCTTextDecorationLineType.h <Text> module add textDecoration style attributes 2015-07-07 06:15:20 -08:00
RCTView.h Converted zIndex to integers 2016-06-09 09:58:31 -07:00
RCTView.m dont use ios border rendering if we use default black color 2016-08-23 03:58:34 -07:00
RCTViewControllerProtocol.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTViewManager.h BREAKING - Fix unconstraint sizing in main axis 2016-09-26 06:13:56 -07:00
RCTViewManager.m BREAKING - Fix unconstraint sizing in main axis 2016-09-26 06:13:56 -07:00
RCTWebView.h Implemented stopLoading 2016-04-22 08:15:25 -07:00
RCTWebView.m Implemented stopLoading 2016-04-22 08:15:25 -07:00
RCTWebViewManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTWebViewManager.m Add WebView.dataDetectorTypes prop. 2016-07-13 14:43:25 -07:00
RCTWrapperViewController.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWrapperViewController.m Added the ability to set an image title in the NavigatorIOS 2016-06-23 08:28:30 -07:00
UIView+Private.h Implement CSS z-index for iOS 2016-06-07 07:43:49 -07:00
UIView+React.h Cleanup warnings 2016-07-12 05:59:12 -07:00
UIView+React.m Converted zIndex to integers 2016-06-09 09:58:31 -07:00