Skip to content

Commit c3f267f

Browse files
authored
[table-dev-app] feat: Add copy option to body context menu (#5720)
1 parent 1c11468 commit c3f267f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/table-dev-app/src/mutableTable.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
Cell,
4040
Column,
4141
ColumnHeaderCell2,
42+
CopyCellsMenuItem,
4243
EditableCell2,
4344
EditableName,
4445
FocusedCellCoordinates,
@@ -55,6 +56,7 @@ import {
5556
TruncatedPopoverMode,
5657
Utils,
5758
} from "@blueprintjs/table";
59+
import { IMenuContext } from "@blueprintjs/table/src";
5860
import type { ColumnIndices, RowIndices } from "@blueprintjs/table/src/common/grid";
5961

6062
import { DenseGridMutableStore } from "./denseGridMutableStore";
@@ -1109,9 +1111,10 @@ export class MutableTable extends React.Component<{}, IMutableTableState> {
11091111
return handleStringChange(value => this.setState({ [stateKey]: value }));
11101112
};
11111113

1112-
private renderBodyContextMenu = () => {
1114+
private renderBodyContextMenu = (context: IMenuContext) => {
11131115
const menu = (
11141116
<Menu>
1117+
<CopyCellsMenuItem context={context} icon="clipboard" getCellData={this.getCellValue} text="Copy" />
11151118
<MenuItem icon="search-around" text="Item 1" />
11161119
<MenuItem icon="search" text="Item 2" />
11171120
<MenuItem icon="graph-remove" text="Item 3" />

0 commit comments

Comments
 (0)