From 3cfcd401c1f3e3297ffa9a3abf8bc3a8f286fa33 Mon Sep 17 00:00:00 2001 From: Thomas Parslow Date: Thu, 10 Dec 2015 12:42:22 -0800 Subject: [PATCH] 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 --- Libraries/CustomComponents/ListView/ListView.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/CustomComponents/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js index fa29da5d8..5b1ef4db0 100644 --- a/Libraries/CustomComponents/ListView/ListView.js +++ b/Libraries/CustomComponents/ListView/ListView.js @@ -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) {