diff --git a/src/scrollsnap-polyfill.js b/src/scrollsnap-polyfill.js index 9c3714e..eb8a89e 100644 --- a/src/scrollsnap-polyfill.js +++ b/src/scrollsnap-polyfill.js @@ -320,8 +320,8 @@ // check if object snappoint is "close" enough to scrollable snappoint // not scrolled past element snap coords - if ((left <= snapCoords.x && left + getWidth(scrollObj) >= snapCoords.x && - top <= snapCoords.y && top + getHeight(scrollObj) >= snapCoords.y)) { + if ((left*primaryDirection <= snapCoords.x*primaryDirection && + top*primaryDirection <= snapCoords.y*primaryDirection)) { // ok, we found a snap point. currentIteration = i; // stay in bounds (minimum: 0, maxmimum: absolute height)