File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
vnext/Microsoft.ReactNative/Fabric/Composition Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -809,7 +809,17 @@ void ScrollViewComponentView::updateProps(
809809 if (oldViewProps.snapToStart != newViewProps.snapToStart || oldViewProps.snapToEnd != newViewProps.snapToEnd ||
810810 oldViewProps.snapToOffsets != newViewProps.snapToOffsets ||
811811 oldViewProps.snapToInterval != newViewProps.snapToInterval ) {
812- updateSnapPoints ();
812+ if (newViewProps.snapToInterval > 0 || oldViewProps.snapToInterval != newViewProps.snapToInterval ) {
813+ // Use the comprehensive updateSnapPoints method when snapToInterval is involved
814+ updateSnapPoints ();
815+ } else {
816+ // Keep original inline logic for the basic snapToOffsets case
817+ const auto snapToOffsets = winrt::single_threaded_vector<float >();
818+ for (const auto &offset : newViewProps.snapToOffsets ) {
819+ snapToOffsets.Append (static_cast <float >(offset));
820+ }
821+ m_scrollVisual.SetSnapPoints (newViewProps.snapToStart , newViewProps.snapToEnd , snapToOffsets.GetView ());
822+ }
813823 }
814824}
815825
You can’t perform that action at this time.
0 commit comments