Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AntD select dropdown scroll issue #13585

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
import React from 'react';
import { ConfigProvider } from 'antd';
import { styled, t } from '@superset-ui/core';
import ReactCronPicker, { Locale, CronProps } from 'react-js-cron';

Expand Down Expand Up @@ -103,7 +104,11 @@ export const LOCALE: Locale = {
};

export const CronPicker = styled((props: CronProps) => (
<ReactCronPicker locale={LOCALE} {...props} />
<ConfigProvider
getPopupContainer={trigger => trigger.parentElement as HTMLElement}
>
<ReactCronPicker locale={LOCALE} {...props} />
</ConfigProvider>
))`
.react-js-cron-select:not(.react-js-cron-custom-select) > div:first-of-type,
.react-js-cron-custom-select {
Expand Down
10 changes: 8 additions & 2 deletions superset-frontend/src/common/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import { styled } from '@superset-ui/core';
import { Select as BaseSelect } from 'src/common/components';
import { Select as BaseSelect, SelectProps } from 'src/common/components';

const StyledSelect = styled(BaseSelect)`
const StyledSelect = styled((props: SelectProps<any>) => (
<BaseSelect
getPopupContainer={(trigger: any) => trigger.parentNode}
{...props}
/>
))`
display: block;
`;

Expand Down
6 changes: 3 additions & 3 deletions superset-frontend/src/common/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ export {
Slider,
Row,
Space,
Select,
Skeleton,
Switch,
Tag,
Tabs,
Tooltip,
Input as AntdInput,
} from 'antd';
export { default as Alert, AlertProps } from 'antd/lib/alert';
export { TreeProps } from 'antd/lib/tree';
export { FormInstance } from 'antd/lib/form';
export { RadioChangeEvent } from 'antd/lib/radio';
export { TreeProps } from 'antd/lib/tree';
export { default as Alert, AlertProps } from 'antd/lib/alert';
export { default as Select, SelectProps } from 'antd/lib/select';

export { default as Collapse } from './Collapse';
export { default as Progress } from './ProgressBar';
Expand Down