stayInGroup breaks snapToGrid

I’m trying to build a diagram that uses the swim lanes example.
I also enabled a 20x20 grid and snap to grid.

If I remove dragComputation: stayInGroup from the node template, the node snaps to grid but now I can drag the node outside the lane.

I also tried using SelectionMoved and mouseDrop on the diagram options but I don’t get the same result. Do you have any solution for that?

In the stayInGroup function, just replace the uses of pt with gridpt.

      function stayInGroup(part, pt, gridpt) {
        // don't constrain top-level nodes
        var grp = part.containingGroup;
        if (grp === null) return gridpt;
        // try to stay within the background Shape of the Group
        var back = grp.resizeObject;
        if (back === null) return gridpt;
        // allow dragging a Node out of a Group if the Shift key is down
        if (part.diagram.lastInput.shift) return gridpt;
        var p1 = back.getDocumentPoint(go.Spot.TopLeft);
        var p2 = back.getDocumentPoint(go.Spot.BottomRight);
        var b = part.actualBounds;
        var loc = part.location;
        // find the padding inside the group's placeholder that is around the member parts
        var m = grp.placeholder.padding;
        // now limit the location appropriately
        var x = Math.max(p1.x + m.left, Math.min(gridpt.x, p2.x - m.right - b.width - 1)) + (loc.x - b.x);
        var y = Math.max(p1.y +, Math.min(gridpt.y, p2.y - m.bottom - b.height - 1)) + (loc.y - b.y);
        return new go.Point(x, y);

Thank you!