Custom context menu click issue for button

I have used the custom context menu and the context menu is working fine on click. But the context menu is not working on click on button and it work for textblock. You can see the below code and added the context menu outside the button and it works. But if I add the same code in the button, the context menu is not showing.

const myContextMenu = $(go.HTMLInfo, {
show: this.showContextMenu,
hide: this.hideContextMenu

var linkTemplate =
      curve: go.Link.Bezier,
      adjusting: go.Link.Stretch,
      selectionAdorned: false,
      corner: 20,
    }, {
    fromPortChanged: this.updateLinkColor,
    toPortChanged: this.updateLinkColor
  }, {
    reshapable: true,
    resegmentable: false

    new go.Binding("points").makeTwoWay(),
    new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify),
    new go.Binding("adusting").makeTwoWay(),
        name: "SHAPE",
        strokeWidth: 2,
        stroke: "#003366",
    $(go.Shape, { toArrow: "Standard" }),
    $(go.Panel, "Auto",
      $(go.Shape, "RoundedRectangle", {
        fill: "white",
        strokeWidth: 2,
        height: 20,
        stroke: "#f5f5f5"


        toolTip: $("ToolTip", {
          "Border.fill": "#f5f5f5"
          $(go.TextBlock, {
            margin: 4
            new go.Binding("text"))
          name: "linkTextBlock",
          textAlign: "center",
          font: "9pt helvetica, arial, sans-serif",
          textValidation: this.validateTextLabel,
          margin: 14
        new go.Binding("editable", "", function (v) {
          if (v.category === "applink") {
            return false;
          } else {
            return true;
        new go.Binding("text", "linkText").makeTwoWay()),
        contextMenu: myContextMenu,
        click: function (e, node) {
        contextClick: function (e, node) { e.handled = true; }// end Adornment
      $("Button", {
        name: "Button",
        alignment: go.Spot.RightCenter,
        visible: true,
        $(go.Shape, {
          figure: "PlusLine",
          width: 4,
          height: 4,

What is that “Button” supposed to do? I notice that it does not have a click event handler.

If it is merely intended to provide an affordance for the user to click to bring up the context menu, don’t use a “Button”. Just have a regular GraphObject there that has the appearance that you want. Maybe with mouseEnter/mouseLeave behavior.