Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 423babd

Browse files
author
Luke Barnard
committed
Remove fairly redundant condition
Making sure that a node is intersected by the bottom of the wrapper is a bit overkill, given that we iterate from the bottom. This also prevents the scenario of having no nodes that are not precisely intersected, but possibly straddling the bottom of the wrapper.
1 parent 47f29b9 commit 423babd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/components/structures/ScrollPanel.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,7 @@ module.exports = React.createClass({
599599
// as the scrollToken.
600600
// If this is false for the entire for-loop, we default to the last node
601601
// (which is why newScrollState is set on every iteration).
602-
if (boundingRect.top < wrapperRect.bottom &&
603-
wrapperRect.bottom < boundingRect.bottom) {
602+
if (boundingRect.top < wrapperRect.bottom) {
604603
// Use this node as the scrollToken
605604
break;
606605
}

0 commit comments

Comments
 (0)