Angular-Gridster2-拖动时网格项目重叠

时间:2018-06-25 17:30:18

标签: angular overlap angular-gridster2

Angular版本-4.0.0

angular-gridster2-2.10.0

将项目随机拖动到其他项目上时,它会重叠(如下图所示)

带圆圈的数字是link

Overlapped Items

组件:

cols X rows

HTML:

   private initialize() {
     this.options = {
      direction: 'vertical',
      gridType: 'fixed',
      compactUp: false,
      compactLeft: false,
      margin: 25,
      outerMargin: true,
      pushItems: true,
      minCols: 3,
      maxCols: 3,
      minRows: 2,
      maxRows: 100,
      maxItemCols: 100,
      minItemCols: 1,
      maxItemRows: 100,
      minItemRows: 1,
      defaultItemCols: 1,
      defaultItemRows: 1,
      fixedColWidth: 340,
      fixedRowHeight: 252,
      displayGrid: 'none'
     };

    if (this.allowEdit) {
      this.setDraggableAndResizableOptions();
    }
  }

  setDraggableAndResizableOptions() {
    this.options.itemChangeCallback = this.itemChange.bind(this);
    this.options.itemResizeCallback = GridsterViewComponent.itemResize;
    this.options.draggable = {
      enabled: this.allowEdit,
      stop: this.eventStop.bind(this)
    };
    this.options.resizable = {
      enabled: false,
      stop: this.eventStop.bind(this)
    };
    this.options.displayGrid = 'onDrag&Resize';
  }

上述行为是随机发生的。没有特定的步骤集来重现此错误。 你能告诉我我哪里出问题了吗?

1 个答案:

答案 0 :(得分:0)

这是一个已知问题,已在3.15.2中修复 问题链接:https://github.com/tiberiuzuld/angular-gridster2/issues/145