@micromag/element-scroll 0.3.769 → 0.3.771
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.
- package/es/index.js +3 -2
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var defaultProps = {
|
|
|
39
39
|
scrolleeClassName: null,
|
|
40
40
|
children: null,
|
|
41
41
|
scrollPosition: null,
|
|
42
|
-
triggers: [0.25, 0.5, 0.75, 1.0],
|
|
42
|
+
triggers: [0.1, 0.25, 0.5, 0.75, 0.9, 1.0],
|
|
43
43
|
onScrolledTrigger: null,
|
|
44
44
|
onScrolledBottom: null,
|
|
45
45
|
onScrolledNotBottom: null,
|
|
@@ -93,12 +93,13 @@ function Scroll(_ref) {
|
|
|
93
93
|
var newWithArrow = scrollY <= 1;
|
|
94
94
|
var maxScrollAmount = scrolleeHeight - scrollableHeight;
|
|
95
95
|
var nowReachedBottom = scrollY + 1 >= maxScrollAmount;
|
|
96
|
-
var progress = Math.min(Math.max(scrollY + 1 / maxScrollAmount, 0), 1);
|
|
96
|
+
var progress = Math.min(Math.max((scrollY + 1) / maxScrollAmount, 0), 1);
|
|
97
97
|
var newTriggersCompleted = (triggers || []).filter(function (step) {
|
|
98
98
|
return progress >= step && triggersCompletedRef.current.indexOf(step) === -1;
|
|
99
99
|
});
|
|
100
100
|
newTriggersCompleted.forEach(function (step) {
|
|
101
101
|
if (onScrolledTrigger != null) {
|
|
102
|
+
// console.log('call me', step, progress);
|
|
102
103
|
onScrolledTrigger(step);
|
|
103
104
|
}
|
|
104
105
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-scroll",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.771",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"access": "public",
|
|
72
72
|
"registry": "https://registry.npmjs.org/"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "a74bf984979f2bee58b57859808a8d9f6fa31f4a"
|
|
75
75
|
}
|