From f697836cfa34884690229dbc1f0fa89e31b03491 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 3 Dec 2019 08:09:54 -0800 Subject: [PATCH] Fabric: Disabling ScrollView's contentOffset propagation to ShadowNode tree Summary: This diff disables the feature that propagates ScrollView's content offset to ShadowNode hierarchy making measuring content-offset-aware. Seems that feature breaks FlatList because it does not expect measure calls to be content-offset-aware. We need to validate which legacy `measure*` calls should be content-offset-aware and which should not, and then verify that actual feature works (it's not clear why it worked with FlatList before) well before re-enabling this. For now, the most safer choice is to disable this feature because I don't think some call sites actually rely on it now. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D18777939 fbshipit-source-id: 20d6c1081e7d2cc3b5a7a172ed947a9ae9cdfaab --- .../ComponentViews/ScrollView/RCTScrollViewComponentView.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index ca45882d7d1..18e53616115 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -196,6 +196,9 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg - (void)_updateStateWithContentOffset { + /* + Propagation ScrollView's contentOffset value to ShadowNode tree is temporarily disabled. + auto contentOffset = RCTPointFromCGPoint(_scrollView.contentOffset); _state->updateState([contentOffset](ScrollViewShadowNode::ConcreteState::Data const &data) { @@ -203,6 +206,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg newData.contentOffset = contentOffset; return newData; }); + */ } - (void)prepareForRecycle