Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SomMeri opened this issue Oct 14, 2019 · 2 comments
Closed

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

SomMeri opened this issue Oct 14, 2019 · 2 comments

Comments

@SomMeri
Copy link

SomMeri commented Oct 14, 2019

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.

@adumesny
Copy link
Member

adumesny commented Nov 7, 2019

actually if you label them 'item 1' and 'item 2' you will see in rev3
[2]
[1]

while in your fix you get
[1]
[2]

I think ideally not specify a position should land you
[1] [2]
instead of both trying to go space (0,0) as you have...

the overlap and wrong size is incorrect in v0.4 and v0.5 (get inf loop error) so we NEED a fix, don't think this is best fix.

@radiolips
Copy link
Member

@SomMeri Thanks for logging this and thanks for putting in a PR! @adumesny put in a slightly different version, which I think will help solve the problem. Try this out with our latest develop branch version! Please reopen or log a new ticket if your problem still isn't resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants