Fix bug on Links, Array, Emails, Phones Field inputs (#16603)
The following PR introduced several bugs: https://github.com/twentyhq/twenty/pull/16042 https://github.com/user-attachments/assets/2c0fd211-3579-4a22-9a5f-dcec9cbe6a2e
This commit is contained in:
+4
-5
@@ -7,6 +7,7 @@ import { useEffect, useState } from 'react';
|
||||
|
||||
import { PhoneCountryPickerDropdownSelect } from './PhoneCountryPickerDropdownSelect';
|
||||
|
||||
import { PHONE_COUNTRY_CODE_PICKER_DROPDOWN_ID } from '@/ui/input/components/internal/phone/constants/PhoneCountryCodePickerDropdownId';
|
||||
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
|
||||
import { isDropdownOpenComponentState } from '@/ui/layout/dropdown/states/isDropdownOpenComponentState';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
@@ -77,17 +78,15 @@ export const PhoneCountryPickerDropdownButton = ({
|
||||
|
||||
const [selectedCountry, setSelectedCountry] = useState<Country>();
|
||||
|
||||
const dropdownId = 'country-picker-dropdown-id';
|
||||
|
||||
const isDropdownOpen = useRecoilComponentValue(
|
||||
isDropdownOpenComponentState,
|
||||
dropdownId,
|
||||
PHONE_COUNTRY_CODE_PICKER_DROPDOWN_ID,
|
||||
);
|
||||
|
||||
const { closeDropdown } = useCloseDropdown();
|
||||
|
||||
const handleChange = (countryCode: string) => {
|
||||
closeDropdown(dropdownId);
|
||||
closeDropdown(PHONE_COUNTRY_CODE_PICKER_DROPDOWN_ID);
|
||||
onChange(countryCode);
|
||||
};
|
||||
|
||||
@@ -102,7 +101,7 @@ export const PhoneCountryPickerDropdownButton = ({
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
dropdownId="country-picker-dropdown-id"
|
||||
dropdownId={PHONE_COUNTRY_CODE_PICKER_DROPDOWN_ID}
|
||||
clickableComponent={
|
||||
<StyledDropdownButtonContainer isUnfolded={isDropdownOpen}>
|
||||
<StyledIconContainer>
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export const PHONE_COUNTRY_CODE_PICKER_DROPDOWN_ID =
|
||||
'phone-country-picker-dropdown-id';
|
||||
Reference in New Issue
Block a user