{"action":"created","issue":{"url":"https://api.github.com/repos/ajaxorg/ace/issues/2651","labels_url":"https://api.github.com/repos/ajaxorg/ace/issues/2651/labels{/name}","comments_url":"https://api.github.com/repos/ajaxorg/ace/issues/2651/comments","events_url":"https://api.github.com/repos/ajaxorg/ace/issues/2651/events","html_url":"https://github.com/ajaxorg/ace/issues/2651","id":103266995,"number":2651,"title":"editor resize doesn't work with knockout: if binding","user":{"login":"karlp","id":127907,"avatar_url":"https://avatars.githubusercontent.com/u/127907?v=3","gravatar_id":"","url":"https://api.github.com/users/karlp","html_url":"https://github.com/karlp","followers_url":"https://api.github.com/users/karlp/followers","following_url":"https://api.github.com/users/karlp/following{/other_user}","gists_url":"https://api.github.com/users/karlp/gists{/gist_id}","starred_url":"https://api.github.com/users/karlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlp/subscriptions","organizations_url":"https://api.github.com/users/karlp/orgs","repos_url":"https://api.github.com/users/karlp/repos","events_url":"https://api.github.com/users/karlp/events{/privacy}","received_events_url":"https://api.github.com/users/karlp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-26T13:15:14Z","updated_at":"2015-08-26T15:55:31Z","closed_at":null,"body":"jsfiddle here: http://jsfiddle.net/j021p0rf/\r\n\r\nIf you use knockout's \"if\" binding to not show elements until your page is ready, ace's resizing gets very confused, and shows a blank editor.  calling editor.resize() doesn't fix things.\r\n\r\nonce you've clicked the button, and \"ready\" is true, the editor div appears, and using jquery on the same selectors \"div#editor.ace_editor.ace-tm\" to inspect the \"el.clientHeight\" (and width) properties, I can see that the real visible, non-zero values are available, but inside the this.renderer.onResize() function, \"el.clientHeight\" stays permanently at zero, even after the knockout model has updated.  No amount of physically resizing the window or calling editor.resize() helps."},"comment":{"url":"https://api.github.com/repos/ajaxorg/ace/issues/comments/135078139","html_url":"https://github.com/ajaxorg/ace/issues/2651#issuecomment-135078139","issue_url":"https://api.github.com/repos/ajaxorg/ace/issues/2651","id":135078139,"user":{"login":"karlp","id":127907,"avatar_url":"https://avatars.githubusercontent.com/u/127907?v=3","gravatar_id":"","url":"https://api.github.com/users/karlp","html_url":"https://github.com/karlp","followers_url":"https://api.github.com/users/karlp/followers","following_url":"https://api.github.com/users/karlp/following{/other_user}","gists_url":"https://api.github.com/users/karlp/gists{/gist_id}","starred_url":"https://api.github.com/users/karlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlp/subscriptions","organizations_url":"https://api.github.com/users/karlp/orgs","repos_url":"https://api.github.com/users/karlp/repos","events_url":"https://api.github.com/users/karlp/events{/privacy}","received_events_url":"https://api.github.com/users/karlp/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T15:55:31Z","updated_at":"2015-08-26T15:55:31Z","body":"Fine.  I would really like to see this sort of magic listed near the resize() docs, as the docs for resize() sounded like exactly what I needed.  \"you changed stuff outside the normal way\"\r\n\r\nNow, sure, I'm clearly not enough of a DOM wizard to appreciate the differences between \"removed the element from the dom\" vs \"modified things outside\" but that's why I was tracing into resize to work out why it doesn't work.  Clearly, I'm just \"doin it wrong\" but what then are the cases where resize() _is_ useful?  It's painfully non-obvious to non-experts when you can use developer tools in chromium, see_ the editor elements in the right place, but with size 0, and then have resize() not fix that problem.\r\n\r\nSee the images at http://imgur.com/1iXsfP8,IilFl0F for why this looks like resize isn't working.  "}}