From 52ca6f6569108c61260f467652cd2b88c955f3e2 Mon Sep 17 00:00:00 2001 From: Thomas Nardone Date: Wed, 8 May 2024 14:32:24 -0700 Subject: [PATCH] Enable synchronous scroll events (#44490) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44490 Changelog: [internal] Enable the experimental syncOnScroll flag in JS. Reviewed By: sammy-SC Differential Revision: D56886404 fbshipit-source-id: 6d5081cdcd319b73f0dc4329adc4e2cd7ba17139 --- .../ScrollView/AndroidHorizontalScrollViewNativeComponent.js | 1 + .../Components/ScrollView/ScrollViewNativeComponent.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js b/packages/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js index c99ea196ae3..bdaef9b9094 100644 --- a/packages/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +++ b/packages/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js @@ -31,6 +31,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = { pagingEnabled: true, persistentScrollbar: true, horizontal: true, + enableSyncOnScroll: true, scrollEnabled: true, scrollEventThrottle: true, scrollPerfTag: true, diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js b/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js index 41a7f723878..aa4f79b921d 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js @@ -45,6 +45,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = diff: require('../../Utilities/differ/pointsDiffer'), }, decelerationRate: true, + enableSyncOnScroll: true, // Fabric only. disableIntervalMomentum: true, maintainVisibleContentPosition: true, pagingEnabled: true, @@ -134,7 +135,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = contentInsetAdjustmentBehavior: true, decelerationRate: true, endDraggingSensitivityMultiplier: true, - enableSyncOnScroll: true, // iOS-Fabric only. + enableSyncOnScroll: true, // Fabric only. directionalLockEnabled: true, disableIntervalMomentum: true, indicatorStyle: true,