Use 'visibleLength' if 'contentLength' is less
Summary: This prevents the 'distanceFromEnd' from being negative when 'offset' is zero, for example. Closes https://github.com/facebook/react-native/pull/3074 Reviewed By: svcscm Differential Revision: D2610771 Pulled By: sahrens fb-gh-sync-id: f878f1c1b865063294013c3bb96b90831877d372
This commit is contained in:
parent
2797bc2069
commit
5dd3b88a81
|
@ -500,9 +500,11 @@ var ListView = React.createClass({
|
|||
},
|
||||
|
||||
_getDistanceFromEnd: function(scrollProperties) {
|
||||
return scrollProperties.contentLength -
|
||||
scrollProperties.visibleLength -
|
||||
scrollProperties.offset;
|
||||
var maxLength = Math.max(
|
||||
scrollProperties.contentLength,
|
||||
scrollProperties.visibleLength
|
||||
);
|
||||
return maxLength - scrollProperties.visibleLength - scrollProperties.offset;
|
||||
},
|
||||
|
||||
_updateVisibleRows: function(updatedFrames) {
|
||||
|
|
Loading…
Reference in New Issue