From daeb37a4fa5a7c9adcaacc004f165d551c104a1c Mon Sep 17 00:00:00 2001 From: "tom.davies" Date: Thu, 5 Dec 2024 15:28:46 +0000 Subject: [PATCH] feat(multi-select): add onListScrollBottom adds the onListScrollBottom callback, to be called when a user scrolls to the bottom of the select list fix #6752 --- .../multi-select/components.test-pw.tsx | 79 ++++++++++++ .../multi-select-test.stories.tsx | 80 ++++++++++++ .../multi-select/multi-select.component.tsx | 4 + .../select/multi-select/multi-select.mdx | 7 + .../select/multi-select/multi-select.pw.tsx | 122 ++++++++++++++++++ .../multi-select/multi-select.stories.tsx | 90 +++++++++++++ .../select/multi-select/multi-select.test.tsx | 19 +++ 7 files changed, 401 insertions(+) diff --git a/src/components/select/multi-select/components.test-pw.tsx b/src/components/select/multi-select/components.test-pw.tsx index b161b6fc97..04a3cb0f55 100644 --- a/src/components/select/multi-select/components.test-pw.tsx +++ b/src/components/select/multi-select/components.test-pw.tsx @@ -194,6 +194,85 @@ export const MultiSelectLazyLoadTwiceComponent = ( ); }; +export const MultiSelectWithInfiniteScrollComponent = ( + props: Partial, +) => { + const preventLoading = useRef(false); + const preventLazyLoading = useRef(false); + const lazyLoadingCounter = useRef(0); + const [value, setValue] = useState([]); + const [isLoading, setIsLoading] = useState(true); + const asyncList = [ +