fix: TimeZone dropdown clips through screen in Mobile viewport (#7935)

## Description

- This PR fixes the issue #7934

---------

Co-authored-by: martmull <martmull@hotmail.fr>
This commit is contained in:
Harshit Singh
2024-10-28 21:41:41 +05:30
committed by GitHub
parent ca54bc1813
commit cabae4c462
4 changed files with 12 additions and 2 deletions

View File

@ -31,6 +31,7 @@ export type SelectProps<Value extends string | number | null> = {
disableBlur?: boolean;
dropdownId: string;
dropdownWidth?: `${string}px` | 'auto' | number;
dropdownWidthAuto?: boolean;
emptyOption?: SelectOption<Value>;
fullWidth?: boolean;
label?: string;
@ -60,6 +61,7 @@ export const Select = <Value extends string | number | null>({
disableBlur = false,
dropdownId,
dropdownWidth = 176,
dropdownWidthAuto = false,
emptyOption,
fullWidth,
label,
@ -94,6 +96,11 @@ export const Select = <Value extends string | number | null>({
const { closeDropdown } = useDropdown(dropdownId);
const dropDownMenuWidth =
dropdownWidthAuto && selectContainerRef.current?.clientWidth
? selectContainerRef.current?.clientWidth
: dropdownWidth;
return (
<StyledContainer
className={className}
@ -111,7 +118,7 @@ export const Select = <Value extends string | number | null>({
) : (
<Dropdown
dropdownId={dropdownId}
dropdownMenuWidth={dropdownWidth}
dropdownMenuWidth={dropDownMenuWidth}
dropdownPlacement="bottom-start"
clickableComponent={
<SelectControl

View File

@ -28,6 +28,7 @@ export const DateTimeSettingsDateFormatSelect = ({
dropdownWidth={218}
label="Date format"
fullWidth
dropdownWidthAuto
value={value}
options={[
{

View File

@ -27,6 +27,7 @@ export const DateTimeSettingsTimeFormatSelect = ({
dropdownId="datetime-settings-time-format"
dropdownWidth={218}
label="Time format"
dropdownWidthAuto
fullWidth
value={value}
options={[

View File

@ -19,9 +19,10 @@ export const DateTimeSettingsTimeZoneSelect = ({
return (
<Select
disableBlur
dropdownId="settings-accounts-calendar-time-zone"
dropdownWidth={416}
label="Time zone"
dropdownWidthAuto
fullWidth
value={value}
options={[