Skip to content

Commit

Permalink
fix: contextmenu event emit (#5380)
Browse files Browse the repository at this point in the history
Co-authored-by: 宋鹏捷 <[email protected]>
  • Loading branch information
spengjie and 宋鹏捷 authored Jan 31, 2024
1 parent bb84787 commit b56e599
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/g6/src/runtime/controller/interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export class InteractionController {
}

// contextmenu event for canvas
if (event.type === 'pointerdown' && event.button === 2) {
if (isRightClick) {
const contextMenuEvent = getContextMenuEventProps(event, this.graph);
this.graph.emit(`canvas:contextmenu`, contextMenuEvent);
this.graph.emit('contextmenu', contextMenuEvent);
Expand All @@ -297,7 +297,7 @@ export class InteractionController {
}

// contextmenu event for node, edge, or combo
if (event.type === 'pointerdown' && event.button === 2) {
if (isRightClick) {
const contextMenuEvent = getContextMenuEventProps(event, this.graph);
this.graph.emit(`${itemType}:contextmenu`, contextMenuEvent);
this.graph.emit('contextmenu', contextMenuEvent);
Expand Down

0 comments on commit b56e599

Please sign in to comment.