{"action":"created","issue":{"url":"https://api.github.com/repos/jbaysolutions/vue-grid-layout/issues/154","repository_url":"https://api.github.com/repos/jbaysolutions/vue-grid-layout","labels_url":"https://api.github.com/repos/jbaysolutions/vue-grid-layout/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/jbaysolutions/vue-grid-layout/issues/154/comments","events_url":"https://api.github.com/repos/jbaysolutions/vue-grid-layout/issues/154/events","html_url":"https://github.com/jbaysolutions/vue-grid-layout/issues/154","id":294225731,"number":154,"title":"Child element of grid-item - clientWidth reports zero initially","user":{"login":"tho068","id":7244024,"avatar_url":"https://avatars0.githubusercontent.com/u/7244024?v=4","gravatar_id":"","url":"https://api.github.com/users/tho068","html_url":"https://github.com/tho068","followers_url":"https://api.github.com/users/tho068/followers","following_url":"https://api.github.com/users/tho068/following{/other_user}","gists_url":"https://api.github.com/users/tho068/gists{/gist_id}","starred_url":"https://api.github.com/users/tho068/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tho068/subscriptions","organizations_url":"https://api.github.com/users/tho068/orgs","repos_url":"https://api.github.com/users/tho068/repos","events_url":"https://api.github.com/users/tho068/events{/privacy}","received_events_url":"https://api.github.com/users/tho068/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-04T20:04:22Z","updated_at":"2018-05-09T21:54:54Z","closed_at":null,"author_association":"NONE","body":"Hello\r\n\r\nI am trying to use C3 Gauge chart inside a grid-item and it works, except that it is impossible to set the correct width of the chart, since the parent containers width is reported as zero. After a resize of the widget, the clientwidth is corrected, and the widget is then updated with the correct width.\r\n\r\nDo you know any solutions to this? \r\n\r\nHow is the width assigned to the grid-item?"},"comment":{"url":"https://api.github.com/repos/jbaysolutions/vue-grid-layout/issues/comments/387887457","html_url":"https://github.com/jbaysolutions/vue-grid-layout/issues/154#issuecomment-387887457","issue_url":"https://api.github.com/repos/jbaysolutions/vue-grid-layout/issues/154","id":387887457,"user":{"login":"GopherJ","id":33961674,"avatar_url":"https://avatars1.githubusercontent.com/u/33961674?v=4","gravatar_id":"","url":"https://api.github.com/users/GopherJ","html_url":"https://github.com/GopherJ","followers_url":"https://api.github.com/users/GopherJ/followers","following_url":"https://api.github.com/users/GopherJ/following{/other_user}","gists_url":"https://api.github.com/users/GopherJ/gists{/gist_id}","starred_url":"https://api.github.com/users/GopherJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GopherJ/subscriptions","organizations_url":"https://api.github.com/users/GopherJ/orgs","repos_url":"https://api.github.com/users/GopherJ/repos","events_url":"https://api.github.com/users/GopherJ/events{/privacy}","received_events_url":"https://api.github.com/users/GopherJ/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T21:54:54Z","updated_at":"2018-05-09T21:54:54Z","author_association":"NONE","body":"thanks @tho068, I have the same problem, solved by: \r\n\r\n```javascript\r\n        mounted() {\r\n            // add new layout item\r\n            this.unwatch =  this.$watch(vm => vm.layout.length, function () {\r\n                window.dispatchEvent(new Event('resize'));\r\n            });\r\n        },\r\n        beforeDestroy() {\r\n            this.unwatch();\r\n        }\r\n```\r\nIs there other way to do it ?"}}
{"actor":{"display_login":"GopherJ"}}