ScrollView snapToInterval/snapToOffsets not working when the scrollView width is a float number in IOS. #48393
Labels
Component: ScrollView
Issue: Author Provided Repro
This issue can be reproduced in Snack or an attached project.
Newer Patch Available
Platform: iOS
iOS applications.
Description
ScrollView snapToInterval/snapToOffsets not working when the scrollView width is a float number in IOS, because
isHorizontal
method inRCTEnhancedScrollView
return a unexpected result when the width is a float.In my reproducer: https://snack.expo.dev/@hiyuki/scrollview-snaptointerval-bug, when i set scrollView's width with a integer, such as
100
, snapToInterval/snapToOffsets works fine, but when i set the width with a float number, such as100.3
, snapToInterval/snapToOffsets does't work.Steps to reproduce
React Native Version
0.76.5
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/@hiyuki/scrollview-snaptointerval-bug
Screenshots and Videos
set ScrollView's width with 100.3, snapToInterval/snapToOffsets does't work.
63_1735194854.mp4
set ScrollView's width with 100, snapToInterval/snapToOffsets works fine.
64_1735194855.mp4
The text was updated successfully, but these errors were encountered: