mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Early exit in scrollToOffset if contentOffset wouldn't change
Summary: changelog: [internal] Calling `scrollToOffset` with already set content offset doesn't make sense. Reviewed By: cipolleschi Differential Revision: D38499666 fbshipit-source-id: ee0bb155fa1619dfd49bca434bf2eee7ad7df9e0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
904b3b67e2
commit
dfbf7d4e14
@@ -649,6 +649,10 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
||||
|
||||
- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
|
||||
{
|
||||
if (CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
|
||||
return;
|
||||
}
|
||||
|
||||
[self _forceDispatchNextScrollEvent];
|
||||
|
||||
if (_layoutMetrics.layoutDirection == LayoutDirection::RightToLeft) {
|
||||
|
||||
Reference in New Issue
Block a user