Skip to content

Drag Item is not deletet after drop #3212

@Heavenfighter

Description

@Heavenfighter

Subject of the issue

When dragging item from sidepanel it is not deletet after drop.

Your environment

  • version of gridstack.js: 12.4.1

Removing helper attribute from GridStack.setupDragIn.
So i woul expect that nothing gets cloned.

<!DOCTYPE html>
<html lang="en">
  <head>
    <link
      href="node_modules/gridstack/dist/gridstack.min.css"
      rel="stylesheet"
    />
    <link rel="stylesheet" href="styles.css" />
    <style>
      .grid-stack {
        background: lightgoldenrodyellow;
      }

      .sidebar-item {
        background-color: #18bc9c;
      }

      .grid-stack-item-content {
        color: #2c3e50;
        text-align: center;
        background-color: #18bc9c;
      }
    </style>
    <script src="node_modules/gridstack/dist/gridstack-all.js"></script>
  </head>
  <body>
  <div class="container-fluid">
   
    <div class="row">
      <div class="col-md-8">

        <div class="sidebar">
          <!-- constrained in code using GridStackWidget[] sidebarContent -->
          <div class="sidebar-item">2x1, max=3</div>
         
        </div>
      </div>
      </div>
    </div>

    <div class="row" style="margin-top: 20px">
      <div class="col-md-6">
        <div class="grid-stack" id="left_grid"></div>
      </div>
    </div>
  </div>

  <script type="text/javascript">

    let options = {
      column: 6,
      minRow: 1, // don't collapse when empty
      cellHeight: 70,
      float: true,
      acceptWidgets: function(el) { return true },
   
  
    };
    let grids = GridStack.initAll(options);
    GridStack.setupDragIn('.sidebar-item, .sidebar>.grid-stack-item');

  </script>
</body>
</html>

Expected behavior

Source item should be deleted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions