File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed
ReactCommon/react/renderer/core
Mounting/ComponentViews/ScrollView Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ - (BOOL)touchesShouldCancelInContentView:(__unused UIView *)view
437437
438438- (void )scrollViewDidScroll : (UIScrollView *)scrollView
439439{
440- if (!_isUserTriggeredScrolling) {
440+ if (!_isUserTriggeredScrolling || CoreFeatures::enableGranularScrollViewStateUpdatesIOS ) {
441441 [self _updateStateWithContentOffset ];
442442 }
443443
Original file line number Diff line number Diff line change @@ -276,6 +276,10 @@ - (RCTScheduler *)_createScheduler
276276 CoreFeatures::disableTransactionCommit = true ;
277277 }
278278
279+ if (reactNativeConfig && reactNativeConfig->getBool (" react_fabric:enable_granular_scroll_view_state_updates_ios" )) {
280+ CoreFeatures::enableGranularScrollViewStateUpdatesIOS = true ;
281+ }
282+
279283 auto componentRegistryFactory =
280284 [factory = wrapManagedObject (_mountingManager.componentViewRegistry.componentViewFactory)](
281285 EventDispatcher::Weak const &eventDispatcher, ContextContainer::Shared const &contextContainer) {
Original file line number Diff line number Diff line change @@ -16,5 +16,6 @@ bool CoreFeatures::useNativeState = false;
1616bool CoreFeatures::cacheLastTextMeasurement = false ;
1717bool CoreFeatures::cancelImageDownloadsOnRecycle = false ;
1818bool CoreFeatures::disableTransactionCommit = false ;
19+ bool CoreFeatures::enableGranularScrollViewStateUpdatesIOS = false ;
1920
2021} // namespace facebook::react
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ class CoreFeatures {
4848 // [CATransaction end] This feature flag disables it to measure its impact in
4949 // production.
5050 static bool disableTransactionCommit;
51+
52+ // When enabled, RCTScrollViewComponentView will trigger ShadowTree state
53+ // updates for all changes in scroll position.
54+ static bool enableGranularScrollViewStateUpdatesIOS;
5155};
5256
5357} // namespace facebook::react
You can’t perform that action at this time.
0 commit comments