From 6ae865563f4a7401dc42522da1a0624f2fcde3f5 Mon Sep 17 00:00:00 2001 From: afonso Date: Tue, 14 May 2024 12:47:29 +0100 Subject: [PATCH] feat: Close dropdown on selection --- lib/components/common/CustomMappingDropdown.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/components/common/CustomMappingDropdown.tsx b/lib/components/common/CustomMappingDropdown.tsx index 20fe0c0..b174966 100644 --- a/lib/components/common/CustomMappingDropdown.tsx +++ b/lib/components/common/CustomMappingDropdown.tsx @@ -315,6 +315,7 @@ export default function CustomEntitiesDropdown({ setSelectedOptions(updatedSelectedOptions); } else { setSelectedOptions([...selectedOptions, option]); + setAnchorEl(null); } onSelection(option, !isOptionAlreadySelected) }; @@ -333,6 +334,7 @@ export default function CustomEntitiesDropdown({ if(isCustomDictionaryValid(customDictionaryFieldOption, headerIndexes)){ customDictionaryFieldOption.label = getAbbreviationFromOption(customDictionaryFieldOption, headerIndexes) onCustomDictionaryFieldCreation(customDictionaryFieldOption, true); + setAnchorEl(null); }else{ setErrorMessage("Missing at least one mandatory property (title or abbreviation) ") }