Skip to content

Commit 4d1979a

Browse files
committed
fix: account for ListHeaderComponent length when calculating offset in VirtualizedList - fixes facebook#16612
1 parent 2546c95 commit 4d1979a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Libraries/Lists/VirtualizedList.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
10041004
}
10051005

10061006
_selectOffset(metrics: {x: number, y: number}): number {
1007-
return !this.props.horizontal ? metrics.y : metrics.x;
1007+
return (
1008+
(!this.props.horizontal ? metrics.y : metrics.x) - this._headerLength
1009+
);
10081010
}
10091011

10101012
_maybeCallOnEndReached() {

0 commit comments

Comments
 (0)