INFRA-2867 | fix dropdown length

This commit is contained in:
dhruvjoshi
2024-03-13 13:51:51 +05:30
parent 8f221053ef
commit f502c4a901
5 changed files with 9 additions and 4 deletions

View File

@@ -158,3 +158,6 @@
width: 321px !important;
min-height: unset;
}
.create-incident-single-selector + div {
max-height: 300px;
}

View File

@@ -29,7 +29,9 @@ const useCreateIncidentHelper = (
dispatch({
type: actionTypes.SET_SELECTED_TEAM,
payload: [productListData?.defaultProduct] || [],
payload: productListData?.defaultProduct
? [productListData?.defaultProduct]
: [],
});
};

View File

@@ -23,7 +23,7 @@ const ProductSelector: React.FC<ProductSelectorProps> = (
return (
<AutoComplete
options={options}
selectedOptions={selected.map(option => option.value)}
selectedOptions={selected?.map(option => option?.value)}
variant="bordered"
updateOnChipRemoval={handleChipRemoval}
updateClearAllCallback={handleClearAll}

View File

@@ -35,7 +35,7 @@ const useIncidentFormApi = () => {
const fetchAssignerAndResponder = (product: number[]) => {
try {
dispatch(fetchAssignerAndResponderData(product));
if (product.length > 0) dispatch(fetchAssignerAndResponderData(product));
} catch (error) {
toast.error(
'Something went wrong with assigner and responder data. Please try again later',

View File

@@ -24,7 +24,7 @@ const UpdateIncidentBox: FC = () => {
useEffect(() => {
if (productOptions?.length > 0) {
fetchAssignerAndResponder(
productOptions?.map((product: Team) => product.value),
productOptions?.map((product: Team) => product?.value),
);
}
}, [productOptions]);