fix(dashboard): drag preview not working (#21432)

This commit is contained in:
Stephen Liu 2022-09-12 19:34:28 +08:00 committed by GitHub
parent 7401f15add
commit 99628d3e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,7 @@ import React, {
import { QueryObjectFilterClause, t, styled } from '@superset-ui/core'; import { QueryObjectFilterClause, t, styled } from '@superset-ui/core';
import { Menu } from 'src/components/Menu'; import { Menu } from 'src/components/Menu';
import { AntdDropdown as Dropdown } from 'src/components'; import { AntdDropdown as Dropdown } from 'src/components';
import ReactDOM from 'react-dom';
const MENU_ITEM_HEIGHT = 32; const MENU_ITEM_HEIGHT = 32;
const MENU_VERTICAL_SPACING = 32; const MENU_VERTICAL_SPACING = 32;
@ -116,7 +117,7 @@ const ChartContextMenu = (
[open], [open],
); );
return ( return ReactDOM.createPortal(
<Dropdown <Dropdown
overlay={menu} overlay={menu}
trigger={['click']} trigger={['click']}
@ -133,7 +134,8 @@ const ChartContextMenu = (
height: 1, height: 1,
}} }}
/> />
</Dropdown> </Dropdown>,
document.body,
); );
}; };