From 121889de89a7adfdc66929e9a7d653538e0c477c Mon Sep 17 00:00:00 2001 From: Alan Foster Date: Sat, 19 Aug 2017 01:02:31 +0100 Subject: [PATCH] Network Inspector - Smarter scrolling to bottom --- Libraries/Inspector/NetworkOverlay.js | 76 ++++++++++++++++++--------- 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/Libraries/Inspector/NetworkOverlay.js b/Libraries/Inspector/NetworkOverlay.js index 83a9bbe180b4b2..e81366b26b9106 100644 --- a/Libraries/Inspector/NetworkOverlay.js +++ b/Libraries/Inspector/NetworkOverlay.js @@ -55,6 +55,11 @@ class NetworkOverlay extends React.Component }> { _requestsListView: ?FlatList; + _requestsListViewScrollMetrics: { + offset: number, + visibleLength: number, + contentLength: number + }; _detailScrollView: ?ScrollView; _captureRequestsListView: (listRef: ?FlatList) => void; _renderItemDetail: ( @@ -74,6 +79,12 @@ class NetworkOverlay extends React.Component { @@ -154,13 +165,13 @@ class NetworkOverlay extends React.Component { + status, + timeout, + response, + responseURL, + responseType, + xhr, + ) => { const xhrIndex = this._getRequestIndexByXHRID(xhr._index); if (xhrIndex === -1) { return; @@ -200,7 +211,7 @@ class NetworkOverlay extends React.Component { - this._pressRow(index); - }}> - - - - {item.url} - - - - - {this._getTypeShortName(item.type)} - - + this._pressRow(index); + }}> + + + + {item.url} + + + + {this._getTypeShortName(item.type)} + + + ); } @@ -369,9 +380,19 @@ class NetworkOverlay extends React.Component