Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: antvis/G6
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 387e3d3f9bd9c34f27d7551d06774643a06bd093
Choose a base ref
..
head repository: antvis/G6
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dbf90a1325c03a50c414b29e7295ba83cf547e46
Choose a head ref
Showing with 3 additions and 1 deletion.
  1. +3 −1 packages/g6/src/plugins/contextmenu/index.ts
4 changes: 3 additions & 1 deletion packages/g6/src/plugins/contextmenu/index.ts
Original file line number Diff line number Diff line change
@@ -213,13 +213,15 @@ export class Contextmenu extends BasePlugin<ContextmenuOptions> {
};

private onMenuItemClick = (event: MouseEvent) => {
const { onClick } = this.options;
const { onClick, trigger } = this.options;
if (event.target instanceof HTMLElement) {
if (event.target.className.includes('g6-contextmenu-li')) {
const value = event.target.getAttribute('value') as string;
onClick?.(value, event.target);
this.hide();
}
}

if (trigger !== 'click') this.hide();
};
}