Skip to content

Gridstack not respecting gs-y attribute on initialising #1535

Closed

Description

@Rainbowlemon

Subject of the issue

Items in pre-existing HTML are being ordered incorrectly with respect to their gs-y attributes once GridStack.init() is called.

Your environment

V3.1.2, using HTML5
Chrome 87.0.4280.88

Steps to reproduce

https://jsfiddle.net/Rainbowlemon/721ce803/44/
Sometimes the order is correct if you reorder the HTML, but sometimes it isn't.

Expected behavior

Items should be ordered according to their gs-y attribute

Actual behavior

Items are being ordered semi-randomly and item order is being influenced by its position in the DOM on gridstack init

Activity

  1. adumesny commented on Dec 14, 2020

    @adumesny
    Member

    you need to have grid float: true, for the items to stick to their Y values and not gravitate to the top, then you can set it to false...

    but I guess init() should do that for you since you are not explicitly calling addWidget() one at a time. actually bacthMode should prevent in between layout until we're done loading...

    I can take a look.

  2. added 2 commits that reference this issue on Dec 14, 2020
    e242238
    959b96e
  3. added a commit that references this issue on Dec 14, 2020
    8500483
  4. adumesny commented on Dec 14, 2020

    @adumesny
    Member

    fixed in next release! make sure to donate if you find this lib useful.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions