mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 12:45:37 +08:00
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:
committed by
facebook-github-bot-4
parent
2797bc2069
commit
5dd3b88a81
@@ -500,9 +500,11 @@ var ListView = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_getDistanceFromEnd: function(scrollProperties) {
|
_getDistanceFromEnd: function(scrollProperties) {
|
||||||
return scrollProperties.contentLength -
|
var maxLength = Math.max(
|
||||||
scrollProperties.visibleLength -
|
scrollProperties.contentLength,
|
||||||
scrollProperties.offset;
|
scrollProperties.visibleLength
|
||||||
|
);
|
||||||
|
return maxLength - scrollProperties.visibleLength - scrollProperties.offset;
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateVisibleRows: function(updatedFrames) {
|
_updateVisibleRows: function(updatedFrames) {
|
||||||
|
|||||||
Reference in New Issue
Block a user