Skip to content

Commit 71e2b0f

Browse files
authored
Merge pull request #235 from AlaDouagi/fix-infinite-scroll-on-top
Fix inverse scroll triggering next function on scroll down
2 parents dfc38ea + 991dd6f commit 71e2b0f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,13 @@ export default class InfiniteScroll extends Component<Props, State> {
246246
if (threshold.unit === ThresholdUnits.Pixel) {
247247
return (
248248
target.scrollTop <=
249-
threshold.value + clientHeight - target.scrollHeight + 1 ||
250-
target.scrollTop === 0
249+
threshold.value + clientHeight - target.scrollHeight + 1
251250
);
252251
}
253252

254253
return (
255254
target.scrollTop <=
256-
threshold.value / 100 + clientHeight - target.scrollHeight + 1 ||
257-
target.scrollTop === 0
255+
threshold.value / 100 + clientHeight - target.scrollHeight + 1
258256
);
259257
}
260258

0 commit comments

Comments
 (0)