diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts index 3d4a15dd40..0b6a47defe 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts @@ -377,6 +377,12 @@ export class TableInfo extends S2ChartView { newChart.on(S2Event.GLOBAL_CONTEXT_MENU, event => copyContent(newChart, event, meta)) // touch this.configTouchEvent(newChart, drawOption, meta) + // right click + newChart.once(S2Event.LAYOUT_AFTER_RENDER, () => { + newChart.getCanvasElement().addEventListener('contextmenu', e => { + e.preventDefault() + }) + }) // theme const customTheme = this.configTheme(chart) newChart.setThemeCfg({ theme: customTheme }) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts index 8f1e7486fc..3ce5571741 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts @@ -281,6 +281,12 @@ export class TableNormal extends S2ChartView { newChart.on(S2Event.GLOBAL_CONTEXT_MENU, event => copyContent(newChart, event, meta)) // touch this.configTouchEvent(newChart, drawOption, meta) + // right click + newChart.once(S2Event.LAYOUT_AFTER_RENDER, () => { + newChart.getCanvasElement().addEventListener('contextmenu', e => { + e.preventDefault() + }) + }) // theme const customTheme = this.configTheme(chart) newChart.setThemeCfg({ theme: customTheme })