Skip to content

Commit 81a9b68

Browse files
committed
fix(dashboard): resolve dropdown popup positioning
1 parent 84279ac commit 81a9b68

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import {
6363
} from './styles';
6464
import {
6565
DEFAULT_SORT_COMPARATOR,
66+
DROPDOWN_ALIGN_BOTTOM,
6667
EMPTY_OPTIONS,
6768
MAX_TAG_COUNT,
6869
TOKEN_SEPARATORS,
@@ -776,6 +777,7 @@ const Select = forwardRef(
776777
optionRender={option => <Space>{option.label || option.value}</Space>}
777778
oneLine={oneLine}
778779
css={props.css}
780+
dropdownAlign={DROPDOWN_ALIGN_BOTTOM}
779781
{...props}
780782
showSearch={shouldShowSearch}
781783
ref={ref}

superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import { LabeledValue as AntdLabeledValue } from 'antd/es/select';
2020
import { t } from '@superset-ui/core';
2121
import { rankedSearchCompare } from '../../utils/rankedSearchCompare';
22-
import { RawValue } from './types';
22+
import { RawValue, SelectProps } from './types';
2323

2424
export const MAX_TAG_COUNT = 4;
2525

@@ -33,6 +33,12 @@ export const SELECT_ALL_VALUE: RawValue = t('Select All');
3333

3434
export const VIRTUAL_THRESHOLD = 20;
3535

36+
export const DROPDOWN_ALIGN_BOTTOM: SelectProps['dropdownAlign'] = {
37+
points: ['tl', 'bl'],
38+
offset: [0, 4],
39+
overflow: { adjustX: 0, adjustY: 1 },
40+
};
41+
3642
export const SELECT_ALL_OPTION = {
3743
value: SELECT_ALL_VALUE,
3844
label: String(SELECT_ALL_VALUE),

superset-frontend/packages/superset-ui-core/src/components/Select/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
RefSelectProps,
2525
} from 'antd/es/select';
2626
import { Interpolation, Theme } from '@emotion/react';
27+
import { AlignType } from '@rc-component/trigger/lib/interface';
2728

2829
export type RawValue = string | number;
2930

@@ -167,6 +168,11 @@ export interface BaseSelectProps extends AntdExposedProps {
167168
ref: Ref<RefSelectProps>;
168169

169170
dropdownStyle?: React.CSSProperties;
171+
172+
/**
173+
* It defines the alignment of the dropdown menu.
174+
*/
175+
dropdownAlign?: AlignType;
170176
}
171177

172178
export interface SelectProps extends BaseSelectProps {

0 commit comments

Comments
 (0)