Edge over come on Label when highlighted

Issue
If i highlight the edge it come over the Label.

Expected:
Edge should not come over the label even if edge is highlighted.

Code:

        myDiagram.linkTemplate =
          $(go.Link,
            {
                routing: go.Link.AvoidsNodes,
                relinkableFrom: true,
                relinkableTo: true,
                reshapable: true,
                resegmentable: true,
                fromLinkable: true,
                fromLinkableSelfNode: true,
                fromLinkableDuplicates: true,
                toLinkable: true,
                toLinkableSelfNode: true,
                toLinkableDuplicates: true,
                zOrder: 1,
                mouseEnter: function (e, link) {

                    var x = e.event.clientX - myDiagram.div.offsetLeft;
                    var y = e.event.clientY - myDiagram.div.offsetTop - 130;  // set - 130 as per keyword node size to set the y position 
                    console.log('link focus in. x is' + x + " y is " + y);


                    dataFactory.customNodeObject['e'] = e;
                    dataFactory.customNodeObject['link'] = link;
                    dataFactory.customNodeObject['x'] = x;
                    dataFactory.customNodeObject['y'] = y;
                    link.findObject("HIGHLIGHT").stroke = "rgba(24,87,255,2.0)";
                    link.isHighlighted = true;

                },
                mouseLeave: function (e, link) {
                    var x = e.event.clientX - myDiagram.div.offsetLeft;
                    var y = e.event.clientY - myDiagram.div.offsetTop - 130;  // set - 130 as per keyword node size to set the y position 
                    console.log('link focus out. x is' + x + " y is " + y);
                    if (!((dataFactory.customNodeObject['x'] - x) >= -5 && (dataFactory.customNodeObject['x'] - x) <= 5) || !((dataFactory.customNodeObject['y'] - y) >= -5 && (dataFactory.customNodeObject['y'] - y) <= 5)) {
                        dataFactory.customNodeObject = new Object();
                        link.findObject("HIGHLIGHT").stroke = "gray"; link.isHighlighted = false;

                    }
                },
                mouseDrop: CheckLockBeforeDragDropOnLink,
                toShortLength: 2,

            },
            new go.Binding("points").makeTwoWay(),
             new go.Binding("zOrder"),
            new go.Binding("routing", "routing"),
            new go.Binding("curviness"),
            $(go.Shape, { stroke: "gray", strokeWidth: 1.5, name: "HIGHLIGHT" }),

            $(go.Shape, { fromArrow: "Circle", fill: "gray", strokeWidth: 2, stroke: "gray" }),
            $(go.Shape, { toArrow: 'Standard', fill: "gray", strokeWidth: 2, stroke: "gray" }),

                $(go.Panel, "Auto",
             { _isLinkLabel: true, cursor: "move" },  // marks this Panel as being a draggable label

           $(go.Shape, { isPanelMain: true, fill: "white", stroke: "orange", strokeWidth: 2 },
                 new go.Binding("stroke", "stroke").makeTwoWay()
            ),
          $(go.Shape, "StopSign",
          {
              alignment: go.Spot.TopLeft, margin: 3,
              width: 8, height: 8, fill: "red", visible: visible, stroke: null
          },
         new go.Binding("visible", "visible").makeTwoWay()),
         new go.Binding('visible', 'text', function (t) { return t.trim() !== '' }),


        $(go.TextBlock, "Label", {
            //zOrder: 2,
            margin: 3, editable: true,
            isMultiline: true,  // don't allow embedded newlines
            textValidation: validateText,
            segmentIndex: 0, segmentFraction: 0.5,
            textEdited: function (textBlock, previousText, currentText) {
                if (previousText != currentText) {
                    var selectedData = myDiagram.selection.first().data;
                    if (selectedData.hasOwnProperty('EdgeID')) {
                        var edgeName = currentText.split('\u00AD');
                        if (edgeName.length > 1) {
                            edgeName = currentText.split('\u00AD')[1].trim();
                        } else {
                            edgeName = currentText.trim();
                        }
                        $scope.MBTOperationScope.renameEdge(edgeName);
                    }
                }
            }
        },
            new go.Binding('visible', 'text', function (t) {
                return t.trim() !== ''
            }),
                new go.Binding("text", "text", function (e) {
                    if (e != "") {
                        return "\u00AD   " + e;
                    }
                }).makeTwoWay(),
         {
             toolTip:
                    $("ToolTip",
                      new go.Binding("visible", "text", function (t) {
                          if (t.trim('') == "Associated FL Name :") {
                              t = '';
                          }
                          return !!t;
                      }).ofObject("TB"),
                      $(go.TextBlock,
                        { name: "TB", margin: 4, font: "bold 12px Verdana,serif", stroke: "black" },
                        new go.Binding("text", "", diagramNodeInfo))
                    )
         }
               ),
                { contextMenu: $(go.Adornment) },
             new go.Binding("segmentIndex").makeTwoWay(),
             new go.Binding("segmentFraction").makeTwoWay()
           )
         );

That is because the blue selection Adornment is being shown in front of the selected Link. The same is true for all selected Parts.

You don’t have to have an Adornment when a Part is selected: GoJS Selection -- Northwoods Software
Note that those examples are changing the appearance of selected Nodes, but similar techniques will work with selected Links. Set Link.selectionAdorned to false and change the appearance of the path Shape to suit your needs.

You might want to have Bindings on your Link template path Shape such as:

new go.Binding("stroke", "isSelected", function(h) { return h ? "dodgerblue" : "gray"; }).ofObject(),
new go.Binding("strokeWidth", "isSelected", function(h) { return h ? 4 : 1.5; }).ofObject()

Walter,
Not working,If you give me an example that will be help full.

Ooops, sorry for my mistake in copying the code from one of the samples. Fixed.

Please give me some solution.

I just did. And I have now tested it to make sure that it does actually work.

Walter,
When i do selectionAdorned to false it completely removes the selection of link.

But i want ,user can select the link as well as label will overcome on link.

I think you need to debug your mouseEnter and mouseLeave code along with your Bindings that depend on Part.isSelected.