From cabae4c46239b4473eb5d278b2744df62e62bf8b Mon Sep 17 00:00:00 2001 From: Harshit Singh <73997189+harshit078@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:41:41 +0530 Subject: [PATCH] fix: TimeZone dropdown clips through screen in Mobile viewport (#7935) ## Description - This PR fixes the issue #7934 --------- Co-authored-by: martmull --- .../src/modules/ui/input/components/Select.tsx | 9 ++++++++- .../components/DateTimeSettingsDateFormatSelect.tsx | 1 + .../components/DateTimeSettingsTimeFormatSelect.tsx | 1 + .../components/DateTimeSettingsTimeZoneSelect.tsx | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/ui/input/components/Select.tsx b/packages/twenty-front/src/modules/ui/input/components/Select.tsx index 21e1fb4ee..54c9b1a79 100644 --- a/packages/twenty-front/src/modules/ui/input/components/Select.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/Select.tsx @@ -31,6 +31,7 @@ export type SelectProps = { disableBlur?: boolean; dropdownId: string; dropdownWidth?: `${string}px` | 'auto' | number; + dropdownWidthAuto?: boolean; emptyOption?: SelectOption; fullWidth?: boolean; label?: string; @@ -60,6 +61,7 @@ export const Select = ({ disableBlur = false, dropdownId, dropdownWidth = 176, + dropdownWidthAuto = false, emptyOption, fullWidth, label, @@ -94,6 +96,11 @@ export const Select = ({ const { closeDropdown } = useDropdown(dropdownId); + const dropDownMenuWidth = + dropdownWidthAuto && selectContainerRef.current?.clientWidth + ? selectContainerRef.current?.clientWidth + : dropdownWidth; + return ( ({ ) : (