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:
Charles Bochet
2025-12-16 18:18:15 +01:00
committed by GitHub
parent 576019e465
commit 58c85e7cca
15 changed files with 268 additions and 193 deletions
@@ -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>
@@ -0,0 +1,2 @@
export const PHONE_COUNTRY_CODE_PICKER_DROPDOWN_ID =
'phone-country-picker-dropdown-id';