message: make context-menu insensitive to graph element changes
  Instead of applying the event listener to specific nodes apply it at graph
  level, and use a selector to keep it up to date with the current node set.
  Generate the context-menu when needed
diff: @@ -125,10 +125,18 @@ export class CytoscapeReactWrapper extends React.Component<CytoscapeReactWrapper
  this.cy = cytoscape(opts);
  - // the context menus need a little bit of time for the DOM to settle down before they are added
  + this.cy.on('cxttapstart taphold', 'node[!isGroup]', (event: any) => {
  + event.preventDefault();
  + if (event.target) {
  + const tipNode = this.makeTippyForNode(event.target).instances[0];
  + // hide the tip after 6 seconds otherwise we can get a bunch of persistent tips
  setTimeout(() => {
  - this.buildContextMenus();
  - }, 50);
  + tipNode.hide();
  + }, 6000);
  + tipNode.show();
  + this.cy.on('destroy', () => tipNode.hide());
  + }
  + });
  }
  destroy() {
  @@ -138,9 +146,7 @@ export class CytoscapeReactWrapper extends React.Component<CytoscapeReactWrapper
  }
  }
  - // Build right-click menus for the graph
  - private buildContextMenus() {
  - const makeTippyForNode: any = (node: any) => {
  + private makeTippyForNode = (node: any) => {
  return tippy(node.popperRef(), {
  content: (() => {
  // Remember we on Tippy.js which is html over the cytoscape canvas -- not React JSX
  @@ -174,26 +180,6 @@ export class CytoscapeReactWrapper extends React.Component<CytoscapeReactWrapper
  theme: 'light-border',
  size: 'large'
  });
  - };
  -
  - // add the 'tap' events to trigger tippy context menus for each node
  - this.cy.nodes().each(appNode => {
  - // ignore events if its is coming from a group node
  - if (!appNode.data().isGroup) {
  - appNode.on('cxttapstart taphold', (event: any) => {
  - event.preventDefault();
  - if (event.target) {
  - const tipNode = makeTippyForNode(appNode).instances[0];
  - // hide the tip after 6 seconds otherwise we can get a bunch of persistent tips
  - setTimeout(() => {
  - tipNode.hide();
  - }, 6000);
  - tipNode.show();
  - this.cy.on('destroy', () => tipNode.hide());
  - }
  - });
  - }
  - });
  /**
  * Uncomment for Edge Context Menus; currently we don't have any use for edge menus
  @@ -236,5 +222,5 @@ export class CytoscapeReactWrapper extends React.Component<CytoscapeReactWrapper
  // }
  // });
  // });
  - }
  + };
  }
  