Skip to content

grid with maxRow set can have item at wrong location, hard to move items #1155

Closed

Description

@adumesny

the maxRow test case under gridstack.js\spec\e2e\html shows grid behavior totally broken if you insert an item past the maxRow it shows there and prevents other items from being dragged correctly.

If you move it down (can't bring it back out of bound) then all works as expected including other items dragging.

Your environment

using upcoming 1.0.0 code (feature/rm-jq branch), happens in 0.6.4 as well.

var grid = GridStack.init({float: true, maxRow: 3});

var items = [
  {x: 0, y: 1, width: 1, height: 2},
  {x: 1, y: 3, width: 2, height: 1, text: 'Y=3 out of bound should align'}
];
var count = 0;

grid.batchUpdate();
items.forEach(function (node) {
  node.id = count++;
  grid.addWidget('<div><div class="grid-stack-item-content">' + (node.text? node.text : node.id) +'</div></div>', node);
});
grid.commit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions