From 2b3aff1903b6f16b960b27fd181bebc25f2da406 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Mon, 3 Mar 2025 12:53:37 -0700 Subject: [PATCH] disabled state for select multiple --- .../components/features/modal/NewTermModal/NewTermModal.tsx | 3 ++- web/src/components/ui/select/SelectMultiple.tsx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/components/features/modal/NewTermModal/NewTermModal.tsx b/web/src/components/features/modal/NewTermModal/NewTermModal.tsx index b5e845a86..5e3347a55 100644 --- a/web/src/components/features/modal/NewTermModal/NewTermModal.tsx +++ b/web/src/components/features/modal/NewTermModal/NewTermModal.tsx @@ -116,7 +116,7 @@ const DatasetListContainer: React.FC<{ selectedDatasets: string[]; setSelectedDatasets: React.Dispatch>; }> = React.memo(({ selectedDatasets, setSelectedDatasets }) => { - const { data: datasetsList, isLoading } = useGetDatasets(); + const { data: datasetsList, isLoading, isFetched } = useGetDatasets(); const onChange = useMemoizedFn((v: string[]) => { setSelectedDatasets(v); @@ -134,6 +134,7 @@ const DatasetListContainer: React.FC<{ return ( { className?: string; placeholder?: string; value: string[]; + disabled?: boolean; } export const SelectMultiple: React.FC = React.memo( @@ -26,7 +27,8 @@ export const SelectMultiple: React.FC = React.memo( placeholder = 'Select items...', size = 'default', variant = 'default', - value + value, + disabled }) => { const selectedRecord = useMemo(() => { return itemsProp.reduce>((acc, item) => { @@ -80,6 +82,7 @@ export const SelectMultiple: React.FC = React.memo( selectVariants({ variant, size }), 'relative overflow-hidden pr-0', selectedItems.length > 0 && 'pl-1!', + disabled && 'cursor-not-allowed opacity-80', className )}>