Skip to content

Commit

Permalink
fix antd select dropdown issue (apache#13585)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily Kuang authored and Allan Caetano de Oliveira committed May 21, 2021
1 parent b3d202e commit 18f27ea
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
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

0 comments on commit 18f27ea

Please sign in to comment.