ng-masonry-grid icon indicating copy to clipboard operation
ng-masonry-grid copied to clipboard

Image reOrderItems breaks the grid when columnWidth uses selector

Open m-dinesh-kumar opened this issue 6 years ago • 0 comments

The reOrderItems() function removes all children along with columnWidth selector element.

Masonry options

{
...
    "columnWidth": ".spacer"
...
}

The prototype class has the following code which breaks the grid during items reorder.

NgMasonryGridService.prototype.reorderMasonryItems

This code removes the first spacer element in the grid, which causes the grid misalignment.

            while (this.el.hasChildNodes()) {
                   this.el.removeChild(lastChild);
            }

Please add an condition to check if the columnWidth is an integer or string. If its string then a selector is being used, the removeChild() function can be skipped for columnWidth element.

m-dinesh-kumar avatar Feb 28 '19 19:02 m-dinesh-kumar