From 5b476d0e41914372e1c536a1d691f14216cd19b7 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Mon, 22 Jun 2015 13:37:25 -0700 Subject: [PATCH] [ReactNative] Fix manual ListView loading Summary: @public If something changes in the list view that should trigger more loads, it wouldn't. Example case is tap to load more - only the first new row would load, but it wouldn't trigger a re-measure and subsequent layout of additional new rows. Test Plan: View More in Events works. --- Libraries/CustomComponents/ListView/ListView.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Libraries/CustomComponents/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js index 857f476c1..dda32340c 100644 --- a/Libraries/CustomComponents/ListView/ListView.js +++ b/Libraries/CustomComponents/ListView/ListView.js @@ -275,6 +275,10 @@ var ListView = React.createClass({ } }, + componentDidUpdate: function() { + this._measureAndUpdateScrollProps(); + }, + onRowHighlighted: function(sectionID, rowID) { this.setState({highlightedRow: {sectionID, rowID}}); }, @@ -368,7 +372,6 @@ var ListView = React.createClass({ if (!props.scrollEventThrottle) { props.scrollEventThrottle = DEFAULT_SCROLL_CALLBACK_THROTTLE; } - return (