diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx index e8300f6eb39d..ba1d38f8a233 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx @@ -63,6 +63,7 @@ import { } from './styles'; import { DEFAULT_SORT_COMPARATOR, + DROPDOWN_ALIGN_BOTTOM, EMPTY_OPTIONS, MAX_TAG_COUNT, TOKEN_SEPARATORS, @@ -776,6 +777,7 @@ const Select = forwardRef( optionRender={option => {option.label || option.value}} oneLine={oneLine} css={props.css} + dropdownAlign={DROPDOWN_ALIGN_BOTTOM} {...props} showSearch={shouldShowSearch} ref={ref} diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts b/superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts index dd2797b4a581..d8fbb3dbfaa4 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts @@ -19,7 +19,7 @@ import { LabeledValue as AntdLabeledValue } from 'antd/es/select'; import { t } from '@superset-ui/core'; import { rankedSearchCompare } from '../../utils/rankedSearchCompare'; -import { RawValue } from './types'; +import { RawValue, SelectProps } from './types'; export const MAX_TAG_COUNT = 4; @@ -33,6 +33,12 @@ export const SELECT_ALL_VALUE: RawValue = t('Select All'); export const VIRTUAL_THRESHOLD = 20; +export const DROPDOWN_ALIGN_BOTTOM: SelectProps['dropdownAlign'] = { + points: ['tl', 'bl'], + offset: [0, 4], + overflow: { adjustX: 0, adjustY: 1 }, +}; + export const SELECT_ALL_OPTION = { value: SELECT_ALL_VALUE, label: String(SELECT_ALL_VALUE), diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/types.ts b/superset-frontend/packages/superset-ui-core/src/components/Select/types.ts index 2f52035b434e..7d38dba9d814 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/types.ts @@ -71,6 +71,7 @@ export type AntdExposedProps = Pick< | 'virtual' | 'getPopupContainer' | 'menuItemSelectedIcon' + | 'dropdownAlign' >; export type SelectOptionsType = Exclude;