Skip to content

Commit e3f1ed5

Browse files
committed
fix: DrillContextMenu in editBoard
1 parent 74fa460 commit e3f1ed5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

frontend/src/app/pages/DashBoardPage/components/Widgets/DataChartWidget/DataChartWidgetCore.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import React, {
4040
useRef,
4141
} from 'react';
4242
import styled from 'styled-components/macro';
43+
import { uuidv4 } from 'utils/utils';
4344
import { WidgetActionContext } from '../../ActionProvider/WidgetActionProvider';
4445
import {
4546
boardDrillManager,
@@ -64,7 +65,9 @@ export const DataChartWidgetCore: React.FC<{}> = memo(() => {
6465
}
6566
return dashboardId;
6667
}, [dashboardId, renderMode]);
67-
68+
const containerId = useMemo(() => {
69+
return `${wid}_${uuidv4()}`;
70+
}, [wid]);
6871
const { onWidgetChartClick } = useContext(WidgetActionContext);
6972
const { cacheWhRef: ref, cacheW, cacheH } = useCacheWidthHeight();
7073
const { onWidgetGetData } = useContext(WidgetActionContext);
@@ -210,7 +213,7 @@ export const DataChartWidgetCore: React.FC<{}> = memo(() => {
210213
width={cacheW}
211214
height={cacheH}
212215
drillOption={drillOption}
213-
containerId={wid}
216+
containerId={containerId}
214217
widgetSpecialConfig={widgetSpecialConfig}
215218
scale={scale}
216219
/>
@@ -222,13 +225,13 @@ export const DataChartWidgetCore: React.FC<{}> = memo(() => {
222225
errText,
223226
dataset,
224227
chart,
225-
wid,
228+
containerId,
226229
widgetSpecialConfig,
227230
scale,
228231
]);
229232

230233
return (
231-
<Wrapper id={renderMode + wid} className="widget-chart" ref={ref}>
234+
<Wrapper className="widget-chart" ref={ref}>
232235
<ChartFrameBox>
233236
<ChartDrillContext.Provider
234237
value={{

0 commit comments

Comments
 (0)