Skip to content
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

removeWidget without detaching Node won't reflow the other widgets #411

Closed
BobbyT opened this issue Apr 2, 2016 · 5 comments
Closed

removeWidget without detaching Node won't reflow the other widgets #411

BobbyT opened this issue Apr 2, 2016 · 5 comments

Comments

@BobbyT
Copy link

BobbyT commented Apr 2, 2016

Hi,

I found an bug after using gridstack-angular which lets angular taking care of the DOM and
just uses removeWidget(widget, false) to remove the widget from the gridstackjs inner data structures.

As a result the grid resize itself, but the other widgets around don't move to their new positions.

Take a look at this screenshot (using gridstack-angular demo http://kdietrich.github.io/gridstack-angular/demo/):

I stacked three widgets over each other and removed the middle one. The grid (blue) adjusts, the widgets not.

@kdietrich
Copy link
Contributor

This worked perfectly fine in v0.2.4, the bug was introduced in v0.2.5.

@Terren
Copy link

Terren commented May 5, 2016

I'm encountering this issue as well. Any idea when it might be fixed? Any ideas on a workaround if need be?

@dangji
Copy link

dangji commented May 5, 2016

I tried moving widgets using something like this

$('.grid-stack').data('gridstack').grid.moveNode(node,x,y);

It seemed to work fine at first, but then it stopped working for me.

@ghost
Copy link

ghost commented Jul 21, 2016

I solved this by modifying gridstack-angular's "destroy" function to call Gridstack's batchUpdate() and commit() methods before and after removing the item, respectively.

@kdietrich
Copy link
Contributor

Fixed by #502.

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

No branches or pull requests

5 participants