fix antd select dropdown issue (#13585)

This commit is contained in:
Lily Kuang 2021-03-16 09:32:15 -07:00 committed by GitHub
parent 3078c84d40
commit f2c50f62ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View File

@ -17,6 +17,7 @@
* under the License. * under the License.
*/ */
import React from 'react'; import React from 'react';
import { ConfigProvider } from 'antd';
import { styled, t } from '@superset-ui/core'; import { styled, t } from '@superset-ui/core';
import ReactCronPicker, { Locale, CronProps } from 'react-js-cron'; import ReactCronPicker, { Locale, CronProps } from 'react-js-cron';
@ -103,7 +104,11 @@ export const LOCALE: Locale = {
}; };
export const CronPicker = styled((props: CronProps) => ( 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-select:not(.react-js-cron-custom-select) > div:first-of-type,
.react-js-cron-custom-select { .react-js-cron-custom-select {

View File

@ -16,10 +16,16 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
import React from 'react';
import { styled } from '@superset-ui/core'; 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; display: block;
`; `;

View File

@ -44,7 +44,6 @@ export {
Slider, Slider,
Row, Row,
Space, Space,
Select,
Skeleton, Skeleton,
Switch, Switch,
Tag, Tag,
@ -52,10 +51,11 @@ export {
Tooltip, Tooltip,
Input as AntdInput, Input as AntdInput,
} from 'antd'; } from 'antd';
export { default as Alert, AlertProps } from 'antd/lib/alert';
export { TreeProps } from 'antd/lib/tree';
export { FormInstance } from 'antd/lib/form'; export { FormInstance } from 'antd/lib/form';
export { RadioChangeEvent } from 'antd/lib/radio'; 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 Collapse } from './Collapse';
export { default as Progress } from './ProgressBar'; export { default as Progress } from './ProgressBar';