Revert "fix: Country Dropdown not closing with AddressInput " (#8174)
Reverts twentyhq/twenty#8147
This commit is contained in:
committed by
GitHub
parent
31ecaf2a0d
commit
d887a857ca
@ -5,7 +5,9 @@ import { Key } from 'ts-key-enum';
|
||||
import { FieldAddressDraftValue } from '@/object-record/record-field/types/FieldInputDraftValue';
|
||||
import { FieldAddressValue } from '@/object-record/record-field/types/FieldMetadata';
|
||||
import { CountrySelect } from '@/ui/input/components/internal/country/components/CountrySelect';
|
||||
import { SELECT_COUNTRY_DROPDOWN_ID } from '@/ui/input/components/internal/country/constants/SelectCountryDropdownId';
|
||||
import { TextInputV2 } from '@/ui/input/components/TextInputV2';
|
||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
|
||||
import { useClickOutsideListener } from '@/ui/utilities/pointer-event/hooks/useClickOutsideListener';
|
||||
import { MOBILE_VIEWPORT } from 'twenty-ui';
|
||||
@ -93,6 +95,10 @@ export const AddressInput = ({
|
||||
const [focusPosition, setFocusPosition] =
|
||||
useState<keyof FieldAddressDraftValue>('addressStreet1');
|
||||
|
||||
const { closeDropdown: closeCountryDropdown } = useDropdown(
|
||||
SELECT_COUNTRY_DROPDOWN_ID,
|
||||
);
|
||||
|
||||
const wrapperRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const getChangeHandler =
|
||||
@ -186,6 +192,8 @@ export const AddressInput = ({
|
||||
callback: (event) => {
|
||||
event.stopImmediatePropagation();
|
||||
|
||||
closeCountryDropdown();
|
||||
|
||||
onClickOutside?.(event, internalValue);
|
||||
},
|
||||
enabled: isDefined(onClickOutside),
|
||||
|
||||
Reference in New Issue
Block a user