@gxpl/sdk 0.0.59 → 0.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -190,16 +190,17 @@ function getDirectionFromDelta(deltaX, deltaY) {
190
190
  return deltaY > 0 ? 'north' : 'south';
191
191
  }
192
192
  function canTransition(direction, el) {
193
+ const boundary = el.getBoundingClientRect();
193
194
  switch (direction) {
194
195
  case 'north':
195
196
  return el.scrollTop <= 0;
196
197
  case 'south': {
197
- const isAllowed = el.scrollTop + el.clientHeight + 1 >= el.scrollHeight;
198
+ const isAllowed = el.scrollTop + boundary.height + 1 >= el.scrollHeight;
198
199
  return isAllowed;
199
200
  }
200
201
  case 'west':
201
202
  return el.scrollLeft === 0;
202
203
  case 'east':
203
- return el.scrollLeft + el.clientWidth === window.innerWidth;
204
+ return Math.abs(el.scrollLeft + boundary.width - window.innerWidth) < 1;
204
205
  }
205
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gxpl/sdk",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",