From 423babdb176d953989d485e89604c6da79303c12 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 5 Apr 2017 17:51:07 +0100 Subject: [PATCH] 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. --- src/components/structures/ScrollPanel.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index 3575d69b3f..63725b8b86 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -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; }