{"action":"created","issue":{"url":"https://api.github.com/repos/gridstack/gridstack.js/issues/573","repository_url":"https://api.github.com/repos/gridstack/gridstack.js","labels_url":"https://api.github.com/repos/gridstack/gridstack.js/issues/573/labels{/name}","comments_url":"https://api.github.com/repos/gridstack/gridstack.js/issues/573/comments","events_url":"https://api.github.com/repos/gridstack/gridstack.js/issues/573/events","html_url":"https://github.com/gridstack/gridstack.js/issues/573","id":196835779,"number":573,"title":"Resizing item height produces item taller than expected on first item added to grid only","user":{"login":"wx007","id":4182007,"avatar_url":"https://avatars2.githubusercontent.com/u/4182007?v=4","gravatar_id":"","url":"https://api.github.com/users/wx007","html_url":"https://github.com/wx007","followers_url":"https://api.github.com/users/wx007/followers","following_url":"https://api.github.com/users/wx007/following{/other_user}","gists_url":"https://api.github.com/users/wx007/gists{/gist_id}","starred_url":"https://api.github.com/users/wx007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wx007/subscriptions","organizations_url":"https://api.github.com/users/wx007/orgs","repos_url":"https://api.github.com/users/wx007/repos","events_url":"https://api.github.com/users/wx007/events{/privacy}","received_events_url":"https://api.github.com/users/wx007/received_events","type":"User","site_admin":false},"labels":[{"id":325605003,"url":"https://api.github.com/repos/gridstack/gridstack.js/labels/severity:minor","name":"severity:minor","color":"009800","default":false},{"id":146257533,"url":"https://api.github.com/repos/gridstack/gridstack.js/labels/type:bug","name":"type:bug","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-21T03:10:58Z","updated_at":"2018-02-15T17:42:16Z","closed_at":null,"author_association":"NONE","body":"I noticed an anomaly while resizing the first item added to a grid. \r\nYou should be able to replicate it by editing the Serialization demo so that the serializedData array contains only the first item. \r\n\r\nThe anomaly is that when you resize the item’s height the placeholder's vertical position (the gray outline) seems to accumulate some sort of math error. The result is that once you stop resizing at the 8th square down, for example, the item will suddenly “jump fill” to the 10th square. The jump is larger the taller you resize the item.\r\nAfter investigating a bit I noticed this jump only occurs on the first item added to the grid and cellHeight seems to change dramatically between the first and successive items. Note that the width seems fine.\r\n\r\ngif attached:\r\n![kapture 2016-12-20 at 18 56 31](https://cloud.githubusercontent.com/assets/4182007/21376016/b13d5850-c6ff-11e6-8fde-715fdd318b26.gif)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/gridstack/gridstack.js/issues/comments/366005250","html_url":"https://github.com/gridstack/gridstack.js/issues/573#issuecomment-366005250","issue_url":"https://api.github.com/repos/gridstack/gridstack.js/issues/573","id":366005250,"user":{"login":"akiross","id":884092,"avatar_url":"https://avatars1.githubusercontent.com/u/884092?v=4","gravatar_id":"","url":"https://api.github.com/users/akiross","html_url":"https://github.com/akiross","followers_url":"https://api.github.com/users/akiross/followers","following_url":"https://api.github.com/users/akiross/following{/other_user}","gists_url":"https://api.github.com/users/akiross/gists{/gist_id}","starred_url":"https://api.github.com/users/akiross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akiross/subscriptions","organizations_url":"https://api.github.com/users/akiross/orgs","repos_url":"https://api.github.com/users/akiross/repos","events_url":"https://api.github.com/users/akiross/events{/privacy}","received_events_url":"https://api.github.com/users/akiross/received_events","type":"User","site_admin":false},"created_at":"2018-02-15T17:42:16Z","updated_at":"2018-02-15T17:42:16Z","author_association":"NONE","body":"This also happens to me. It happens with many elements as well, not just one.\r\n\r\nI think what is happening is that height of the parent item is larger than the height of the area your mouse is moving into (the screen). When I start dragging the handle to resize, **if** the height of the parent is larger than the screen (i.e. overflows), then I get errors in the computed grid heights. If the parent height is less than screen height, then there are no issues.\r\n\r\nI attach below an animation showing the behaviour on my browser (Firefox 58). As you can see, it seems that the height of the \"target\" is computed starting from the height of the parent: if the parent is too big (that is, bigger than the viewport), then things will degenerate and targets will overflow.\r\n\r\n![bug_animation](https://user-images.githubusercontent.com/884092/36271661-8ea5422c-127f-11e8-8172-ce99a4f23c7e.gif)\r\n\r\n"}}
{"actor":{"display_login":"akiross"}}