mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(dashboard): resolve dropdown popup positioning (#36963)
This commit is contained in:
@@ -64,6 +64,7 @@ import {
|
||||
} from './styles';
|
||||
import {
|
||||
DEFAULT_SORT_COMPARATOR,
|
||||
DROPDOWN_ALIGN_BOTTOM,
|
||||
EMPTY_OPTIONS,
|
||||
MAX_TAG_COUNT,
|
||||
TOKEN_SEPARATORS,
|
||||
@@ -777,6 +778,7 @@ const Select = forwardRef(
|
||||
optionRender={option => <Space>{option.label || option.value}</Space>}
|
||||
oneLine={oneLine}
|
||||
css={props.css}
|
||||
dropdownAlign={DROPDOWN_ALIGN_BOTTOM}
|
||||
{...props}
|
||||
showSearch={shouldShowSearch}
|
||||
ref={ref}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import { LabeledValue as AntdLabeledValue } from 'antd/es/select';
|
||||
import { t } from '@apache-superset/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),
|
||||
|
||||
@@ -71,6 +71,7 @@ export type AntdExposedProps = Pick<
|
||||
| 'virtual'
|
||||
| 'getPopupContainer'
|
||||
| 'menuItemSelectedIcon'
|
||||
| 'dropdownAlign'
|
||||
>;
|
||||
|
||||
export type SelectOptionsType = Exclude<AntdProps['options'], undefined>;
|
||||
|
||||
Reference in New Issue
Block a user