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.
This commit is contained in:
Luke Barnard 2017-04-05 17:51:07 +01:00
parent 47f29b9454
commit 423babdb17

View file

@ -599,8 +599,7 @@ module.exports = React.createClass({
// as the scrollToken.
// If this is false for the entire for-loop, we default to the last node
// (which is why newScrollState is set on every iteration).
if (boundingRect.top < wrapperRect.bottom &&
wrapperRect.bottom < boundingRect.bottom) {
if (boundingRect.top < wrapperRect.bottom) {
// Use this node as the scrollToken
break;
}