Skip to content

Commit c449d9e

Browse files
christoph-jerolimovfacebook-github-bot-7
authored andcommitted
Fix an issue (Sticky header index was outside the range) when renderSeparator is defined but returns null
Summary:Fix an issue when using ListView and define `renderSeparator` but the implementation returns null. In such cases the sectionHeaderIndices mismatch the child element index and the app shows a warning like "Sticky header index 18 was outside the range {0, 13}". Closes facebook#5800 Differential Revision: D2980005 Pulled By: vjeux fb-gh-sync-id: cd2d51d83698ed189bb65ea40b7b073644136b49 shipit-source-id: cd2d51d83698ed189bb65ea40b7b073644136b49
1 parent a9846da commit c449d9e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Libraries/CustomComponents/ListView/ListView.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,10 @@ var ListView = React.createClass({
394394
rowID,
395395
adjacentRowHighlighted
396396
);
397-
bodyComponents.push(separator);
398-
totalIndex++;
397+
if (separator) {
398+
bodyComponents.push(separator);
399+
totalIndex++;
400+
}
399401
}
400402
if (++rowCount === this.state.curRenderedRowsCount) {
401403
break;

0 commit comments

Comments
 (0)