Skip to content

grid re-initing messes up widget ordering after widget was removed #3181

@AdmiralSnyder

Description

@AdmiralSnyder

Subject of the issue

I am rendering the context of the div manually and have to re-init the grid after doing widget removals
But there's a bug in the re-initing for which i wrote a repro, see below. that has instructions and buttons to press,
here is a 20s video of the immediate repro of the issue:

GridStackErrorReproReinitShort.mp4

here's a screenshot:

Image

Your environment

  • version of gridstack.js
  • 12.3.3
  • which browser/OS
  • MS Edge on Windows 11
  • Orion (webkit based) on a macbook
Image

Steps to reproduce

here's the demo:
https://stackblitz.com/edit/gridstack-demo-hbv1drk7?file=index.html&file=script.js

  • click button 2
  • observe that the widget "Third" goes away
  • click button 3
  • observe that the widget "Fourth" moved left

Expected behavior

re-initing a grid should not move the widgets if the grid is in float mode and the widgets are declared in the html markup.

full video

this is the full play-through of the repro, as a video:

GridStackErrorReproReinitFull.mp4

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