alump / GridStack

Vaadin layout add-on using gridstack.js library
Apache License 2.0
10 stars 7 forks source link

Auto positioning causes change in coordinates #5

Open klaath opened 8 years ago

klaath commented 8 years ago

Recently, I have observed strange behaviors in the auto positioning feature. It could be a possible bug.

First, when the x and y coordinates are set to -1, after they are positioning into grid their coordinates still remain -1 until they are moved or re-sized. Then, they get their correct positions. Wouldn't be nice if they are set to their correct positions as soon as they are added to the grid?

Second, adding an auto positioning child to the grid causes a change in coordinates of other components (both axes and sizes). The effect is not observed in the UI (JS coordinates remain correct), however server side coordinates become completely different from the UI. I have produced this with the following steps and changes in the DemoUI.

1) Initially, grid contains one "console" component added as [-1,-1 4,2]. step1

2)Add one "Hep" component again as [-1,-1, 1,1] and console component changes as [4,0 1,1]. step2

3)Resize (vertically) "Hep" component and all coordinates get corrected as [0,0 4,2] and [4,0 1,2]. step3

4)Add another auto positioning "Hep" component and all coordinates changes again as [4,0 1,2], [5,0 1,2] and [-1,-1 1,1]. step4

Could you reproduce the issue? If so, do you have any suggestion what might be wrong? I am also looking into this.

Thanks, -K

alump commented 8 years ago

Sorry for really slow response. GitHub doesn't notify me about issues in this project.

But yes, I should see if I can get instant updates to coordinates when client defined position is mapped to actual position.