Skip to content

Commit 22e2bda

Browse files
authored
fix: adjust scroll threshold for fetching more items in Select component (#359)
Signed-off-by: ya zhou <[email protected]>
1 parent 644c2d4 commit 22e2bda

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@
1919
npm-debug.log*
2020
yarn-debug.log*
2121
yarn-error.log*
22+
docs/
23+
packages

src/components/Select/Select.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export default class Select extends React.Component {
288288
const { onFetch, pagination = {} } = this.props;
289289
const { page = 1 } = pagination;
290290
const { scrollTop, scrollHeight, clientHeight } = e.target;
291-
if (Math.abs(scrollTop + clientHeight - scrollHeight) <= 1) {
291+
if (Math.abs(scrollHeight - scrollTop - clientHeight) <= 32) {
292292
this.reachBottom = true;
293293
onFetch({ page: page + 1, more: true });
294294
}

0 commit comments

Comments
 (0)