handleClickEvent(evt) {

    if (this.isZombieWidget() || !this.network) return;

    if (!this.graphDomNode.contains(evt.target)) { // clicked outside

      const selected = this.network.getSelection();
      if (selected.nodes.length || selected.edges.length) {
        this.logger('debug', 'Clicked outside; deselecting nodes/edges');
        // upstream bug: this.network.unselectAll() doesn't work
        this.network.selectNodes([]); // deselect nodes and edges
        this.resetVisManipulationBar();
      }

    } else {

      this.canvas.focus();

    }

    if (evt.button !== 2) { // not the right button
      this.contextMenu.hide(0, true);
    }

  }
used to prevent nasty deletion as edges are not unselected when leaving vis