Support onLayout and onContentSizeChange attributes on ListView

Summary:
Docs say they're supported and presumably they should work exactly as for ScrollView but currently they are intercepted by the ListView
Closes https://github.com/facebook/react-native/pull/4712

Reviewed By: svcscm

Differential Revision: D2745080

Pulled By: vjeux

fb-gh-sync-id: 531907f03ae46d5200003cdb335c10b40c7d3bed
This commit is contained in:
Thomas Parslow
2015-12-10 12:42:22 -08:00
committed by facebook-github-bot-4
parent ac783a8a1b
commit 3cfcd401c1

View File

@@ -436,6 +436,9 @@ var ListView = React.createClass({
height : width;
this._updateVisibleRows();
this._renderMoreRowsIfNeeded();
if (this.props.onContentSizeChange) {
this.props.onContentSizeChange(width, height);
}
},
_onLayout: function(event) {
@@ -444,6 +447,9 @@ var ListView = React.createClass({
height : width;
this._updateVisibleRows();
this._renderMoreRowsIfNeeded();
if (this.props.onLayout) {
this.props.onLayout(event);
}
},
_setScrollVisibleLength: function(left, top, width, height) {