fix: dropdown menu doesn't close and remains open (#8302)

## Description

- Fixes #8285 
- Added fix for both Currency and PhoneCountry dropdown

## Changes



https://github.com/user-attachments/assets/cbf85100-7791-40da-a676-2c87c6a32976

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Harshit Singh
2024-11-08 21:43:15 +05:30
committed by GitHub
parent 045f569d62
commit 0381996fb9
3 changed files with 8 additions and 3 deletions

View File

@ -35,7 +35,12 @@ export const MultiItemFieldMenuItem = <T,>({
const { isDropdownOpen, closeDropdown } = useDropdown(dropdownId);
const handleMouseEnter = () => setIsHovered(true);
const handleMouseLeave = () => setIsHovered(false);
const handleMouseLeave = () => {
setIsHovered(false);
if (isDropdownOpen) {
closeDropdown();
}
};
const handleDeleteClick = () => {
closeDropdown();