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

Item attributes not preserved when moving across/dropping into grid for saving #1367

Closed
patrickkusebauch opened this issue Sep 19, 2020 · 2 comments
Labels

Comments

@patrickkusebauch
Copy link

patrickkusebauch commented Sep 19, 2020

Subject of the issue

If I have an item in another grid or an item outside of the grid dragged into a new grid, it's attributes are not preserved.

Your environment

Version of gridstack.js: 2.0.0
Browser: Chrome on Ubuntu (Version 83.0.4103.61 (Official Build) (64-bit))

Steps to reproduce

  1. Open https://gridstackjs.com/demo/two.html
  2. Drag item with text "has maxWidth=3" from the left grid to the right grid
  3. Open console and type "grids[1].save()" (saves/serializes the right grid item data)

Expected behaviour

The moved item should have its ID attribute saved in the serialized JSON.

Actual behaviour

The moved item does not have its ID attribute saved in the serialized JSON.

@adumesny
Copy link
Member

adumesny commented Sep 19, 2020

very good! you are using my own test beds to find bugs... I should have caught that one, if only I had unit test for drag&drop.

that will also fix the fact that the item can be sort of resized past it's max (well the drop shadow does, actual D&D still constrained to max=3), which I believe has been around for a while. save() is new in 2.0 making it easier to debug...

adumesny added a commit to adumesny/gridstack.js that referenced this issue Sep 27, 2020
* fix for gridstack#1367
* we now copy all nodes attributes when moving between grids
@adumesny
Copy link
Member

fixed in 2.0.1

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

No branches or pull requests

2 participants