@legendapp/list 0.5.2 → 0.5.3
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/index.js +6 -4
- package/index.mjs +6 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -541,7 +541,7 @@ var LegendListInner = React7.forwardRef(function LegendListInner2(props, forward
|
|
|
541
541
|
pendingAdjust: 0,
|
|
542
542
|
animFrameLayout: null,
|
|
543
543
|
animFrameTotalSize: null,
|
|
544
|
-
isStartReached:
|
|
544
|
+
isStartReached: true,
|
|
545
545
|
isEndReached: false,
|
|
546
546
|
isAtBottom: false,
|
|
547
547
|
isAtTop: false,
|
|
@@ -802,15 +802,17 @@ var LegendListInner = React7.forwardRef(function LegendListInner2(props, forward
|
|
|
802
802
|
return;
|
|
803
803
|
}
|
|
804
804
|
const { scrollLength, scroll } = refState.current;
|
|
805
|
-
|
|
805
|
+
const scrollAdjust = peek$(ctx, "scrollAdjust") || 0;
|
|
806
|
+
const distanceFromTop = scroll - scrollAdjust;
|
|
807
|
+
refState.current.isAtTop = distanceFromTop < 0;
|
|
806
808
|
if (onStartReached) {
|
|
807
809
|
if (!refState.current.isStartReached) {
|
|
808
|
-
if (
|
|
810
|
+
if (distanceFromTop < onStartReachedThreshold * scrollLength) {
|
|
809
811
|
refState.current.isStartReached = true;
|
|
810
812
|
onStartReached({ distanceFromStart: scroll });
|
|
811
813
|
}
|
|
812
814
|
} else {
|
|
813
|
-
if (
|
|
815
|
+
if (distanceFromTop >= onStartReachedThreshold * scrollLength) {
|
|
814
816
|
refState.current.isStartReached = false;
|
|
815
817
|
}
|
|
816
818
|
}
|
package/index.mjs
CHANGED
|
@@ -520,7 +520,7 @@ var LegendListInner = forwardRef(function LegendListInner2(props, forwardedRef)
|
|
|
520
520
|
pendingAdjust: 0,
|
|
521
521
|
animFrameLayout: null,
|
|
522
522
|
animFrameTotalSize: null,
|
|
523
|
-
isStartReached:
|
|
523
|
+
isStartReached: true,
|
|
524
524
|
isEndReached: false,
|
|
525
525
|
isAtBottom: false,
|
|
526
526
|
isAtTop: false,
|
|
@@ -781,15 +781,17 @@ var LegendListInner = forwardRef(function LegendListInner2(props, forwardedRef)
|
|
|
781
781
|
return;
|
|
782
782
|
}
|
|
783
783
|
const { scrollLength, scroll } = refState.current;
|
|
784
|
-
|
|
784
|
+
const scrollAdjust = peek$(ctx, "scrollAdjust") || 0;
|
|
785
|
+
const distanceFromTop = scroll - scrollAdjust;
|
|
786
|
+
refState.current.isAtTop = distanceFromTop < 0;
|
|
785
787
|
if (onStartReached) {
|
|
786
788
|
if (!refState.current.isStartReached) {
|
|
787
|
-
if (
|
|
789
|
+
if (distanceFromTop < onStartReachedThreshold * scrollLength) {
|
|
788
790
|
refState.current.isStartReached = true;
|
|
789
791
|
onStartReached({ distanceFromStart: scroll });
|
|
790
792
|
}
|
|
791
793
|
} else {
|
|
792
|
-
if (
|
|
794
|
+
if (distanceFromTop >= onStartReachedThreshold * scrollLength) {
|
|
793
795
|
refState.current.isStartReached = false;
|
|
794
796
|
}
|
|
795
797
|
}
|