hyochan / react-native-masonry-list

The Masonry List implementation which has similar implementation as the `FlatList` in React Native
MIT License
393 stars 55 forks source link

Fix for onEndReached not getting called #45

Closed Vin-Xi closed 1 year ago

Vin-Xi commented 1 year ago

Description

This PR focuses on fixing the onEndReached not getting called, this happens due to the line below layoutMeasurement.height + contentOffset.y >= contentSize.height - paddingToBottom

Where both sides might resolve to a 6+ decimal place number which introduces inaccuracy because of the three different measurements. The fix I have applied is to remove the decimal places from the left hand side by using Math.ceil. This will evaluate to end reached if its on the bottom of the screen regardless of decimal points.

Related Issues

N/A

Tests

N/A

Checklist