From 6ff3a715e020905040e8b5ad01ace59a94339efc Mon Sep 17 00:00:00 2001 From: rstubryan Date: Mon, 13 Apr 2026 10:46:51 +0700 Subject: [PATCH] refactor(FE-load-more-option): Add infinite scroll to location and supplier dropdowns --- src/components/pages/expense/form/ExpenseRequestForm.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/pages/expense/form/ExpenseRequestForm.tsx b/src/components/pages/expense/form/ExpenseRequestForm.tsx index adc825c2..b50798c2 100644 --- a/src/components/pages/expense/form/ExpenseRequestForm.tsx +++ b/src/components/pages/expense/form/ExpenseRequestForm.tsx @@ -178,12 +178,14 @@ const ExpenseRequestForm = ({ setInputValue: setLocationInputValue, options: locationOptions, isLoadingOptions: isLoadingLocationOptions, + loadMore: loadMoreLocations, } = useSelect(LocationApi.basePath, 'id', 'name'); const { setInputValue: setVendorInputValue, options: supplierOptions, isLoadingOptions: isLoadingVendorOptions, + loadMore: loadMoreSuppliers, } = useSelect(SupplierApi.basePath, 'id', 'name'); const categoryChangeHandler = (val: OptionType | OptionType[] | null) => { @@ -408,6 +410,7 @@ const ExpenseRequestForm = ({ options={locationOptions} onInputChange={setLocationInputValue} isLoading={isLoadingLocationOptions} + onMenuScrollToBottom={loadMoreLocations} isError={ formik.touched.location_id && Boolean(formik.errors.location_id) } @@ -452,6 +455,7 @@ const ExpenseRequestForm = ({ options={supplierOptions} onInputChange={setVendorInputValue} isLoading={isLoadingVendorOptions} + onMenuScrollToBottom={loadMoreSuppliers} isError={ formik.touched.supplier_id && Boolean(formik.errors.supplier_id) }