diff --git a/.storybook/stories/Components/Select.stories.mdx b/.storybook/stories/Components/Select.stories.mdx index 0fac1fad..9c7411d0 100644 --- a/.storybook/stories/Components/Select.stories.mdx +++ b/.storybook/stories/Components/Select.stories.mdx @@ -93,24 +93,10 @@ Basic usages for `Select` component. {() => { - const data = [ - { value: "CentOS", label: "CentOS 5.8 32bit" }, - { value: "Debian", label: "Debian Jessie 8.1 64bit" }, - { value: "Ubuntu", label: "Ubuntu Server 14.04.3 LTS 64bit" }, - { value: "Windows", label: "Windows Server 2003 R2" }, - { value: "CentOS1", label: "CentOS 5.8 32bit" }, - { value: "Debian1", label: "Debian Jessie 8.1 64bit" }, - { value: "Ubuntu1", label: "Ubuntu Server 14.04.3 LTS 64bit" }, - { value: "Windows1", label: "Windows Server 2003 R2" }, - { value: "CentOS2", label: "CentOS 5.8 32bit" }, - { value: "Debian2", label: "Debian Jessie 8.1 64bit" }, - { value: "Ubuntu2", label: "Ubuntu Server 14.04.3 LTS 64bit" }, - { value: "Windows2", label: "Windows Server 2003 R2" }, - { value: "CentOS3", label: "CentOS 5.8 32bit" }, - { value: "Debian3", label: "Debian Jessie 8.1 64bit" }, - { value: "Ubuntu3", label: "Ubuntu Server 14.04.3 LTS 64bit" }, - { value: "Windows3", label: "Windows Server 2003 R2" }, - ]; + const data = Array.from({ length: 60 }, (_, index) => ({ + value: index.toString(), + label: `Option ${index + 1}`, + })); const [pagination, setPagination] = useState({ page: 1, total: data.length, diff --git a/src/components/Select/Select.jsx b/src/components/Select/Select.jsx index 9f2bad4f..db41812d 100644 --- a/src/components/Select/Select.jsx +++ b/src/components/Select/Select.jsx @@ -294,7 +294,7 @@ export default class Select extends React.Component { const { onFetch, pagination = {} } = this.props; const { page = 1 } = pagination; const { scrollTop, scrollHeight, clientHeight } = e.target; - if (scrollTop + clientHeight - scrollHeight >= 0) { + if (Math.abs(scrollTop + clientHeight - scrollHeight) <= 1) { this.reachBottom = true; onFetch({ page: page + 1, more: true }); }