mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-30 12:22:29 +00:00 
			
		
		
		
	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:
		| @@ -35,7 +35,12 @@ export const MultiItemFieldMenuItem = <T,>({ | |||||||
|   const { isDropdownOpen, closeDropdown } = useDropdown(dropdownId); |   const { isDropdownOpen, closeDropdown } = useDropdown(dropdownId); | ||||||
|  |  | ||||||
|   const handleMouseEnter = () => setIsHovered(true); |   const handleMouseEnter = () => setIsHovered(true); | ||||||
|   const handleMouseLeave = () => setIsHovered(false); |   const handleMouseLeave = () => { | ||||||
|  |     setIsHovered(false); | ||||||
|  |     if (isDropdownOpen) { | ||||||
|  |       closeDropdown(); | ||||||
|  |     } | ||||||
|  |   }; | ||||||
|  |  | ||||||
|   const handleDeleteClick = () => { |   const handleDeleteClick = () => { | ||||||
|     closeDropdown(); |     closeDropdown(); | ||||||
|   | |||||||
| @@ -1,3 +1,3 @@ | |||||||
| export enum CurrencyPickerHotkeyScope { | export enum CurrencyPickerHotkeyScope { | ||||||
|   CurrencyPicker = 'currency-picker', |   CurrencyPicker = 'currency-picker-dropdown-id', | ||||||
| } | } | ||||||
|   | |||||||
| @@ -70,7 +70,7 @@ export const PhoneCountryPickerDropdownButton = ({ | |||||||
|   const [selectedCountry, setSelectedCountry] = useState<Country>(); |   const [selectedCountry, setSelectedCountry] = useState<Country>(); | ||||||
|  |  | ||||||
|   const { isDropdownOpen, closeDropdown } = useDropdown( |   const { isDropdownOpen, closeDropdown } = useDropdown( | ||||||
|     CountryPickerHotkeyScope.CountryPicker, |     'country-picker-dropdown-id', | ||||||
|   ); |   ); | ||||||
|  |  | ||||||
|   const handleChange = (countryCode: string) => { |   const handleChange = (countryCode: string) => { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Harshit Singh
					Harshit Singh