Skip to content

Commit f1697bc

Browse files
committed
feat (ScrollObserverEntry): check axies options
1 parent 749e2e8 commit f1697bc

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

build/OneLoop.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright 2022 OneLoop.js
44
* Author: Nicolas Langle
55
* Repository: https://github.com/n-langle/OneLoop.js
6-
* Version: 5.1.5
6+
* Version: 5.2.0
77
* SPDX-License-Identifier: MIT
88
*
99
* Credit for easing functions goes to : https://github.com/ai/easings.net/blob/master/src/easings/easingsFunctions.ts
@@ -675,7 +675,7 @@ class ScrollObserverEntry {
675675
// if scrollX or scrollY is equal to window width or height
676676
p2.set(p2.x || 0, p2.y || 0);
677677

678-
if (p1.x >= 0 && p1.x <= 1 && p1.y >= 0 && p1.y <= 1) {
678+
if ((this.disableCheckOnAxis === 'x' || p1.x >= 0 && p1.x <= 1) && (!this.disableCheckOnAxis === 'y' || p1.y >= 0 && p1.y <= 1)) {
679679
if (!this._isVisible) {
680680
this._isVisible = true;
681681
this.onVisibilityStart.call(this, scrollInfos, getMinOrMax(p1), getMinOrMax(p2));
@@ -702,6 +702,7 @@ class ScrollObserverEntry {
702702
// ----
703703
ScrollObserverEntry.defaults = {
704704
children: '',
705+
disableCheckOnAxis: '',
705706
onVisible: noop,
706707
onVisibilityStart: noop,
707708
onVisibilityEnd: noop,

0 commit comments

Comments
 (0)