Skip to content

Widgets initiated with undefined data-gs-x and data-gs-y glitch #1017

@SomMeri

Description

@SomMeri

If the widgets do not have initial data-gs-x and data-gs-y specified, widgets are rendered with wrong size. They are also all located on one place.

Your environment

  • version of gridstack.js: 0.4.0 <- it worked correctly in previous versions
  • which browser and its version: all of them

Steps to reproduce + Actual behaviour

Working demo: https://jsfiddle.net/2p7a9wjg/

Both widgets are created without data-gs-x and data-gs-y:

<div class="grid-stack">
    <div class="grid-stack-item upper"
        data-gs-width="2" data-gs-height="2">
            <div class="grid-stack-item-content"></div>
    </div>
    <div class="grid-stack-item"
        data-gs-width="2" data-gs-height="2">
            <div class="grid-stack-item-content"></div>
    </div>
</div>

Only one widget is visible and it is small.

Expected behaviour

This is how it should look like - rendered with 0.3.0: https://jsfiddle.net/m3fxs7u1/4/

Both widgets are visible and they are big.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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