{"action":"closed","issue":{"url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3591","labels_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3591/labels{/name}","comments_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3591/comments","events_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3591/events","html_url":"https://github.com/codemirror/CodeMirror/issues/3591","id":111291182,"number":3591,"title":"How to get CodeMirror to respect the height of its container?","user":{"login":"greggman","id":234804,"avatar_url":"https://avatars.githubusercontent.com/u/234804?v=3","gravatar_id":"","url":"https://api.github.com/users/greggman","html_url":"https://github.com/greggman","followers_url":"https://api.github.com/users/greggman/followers","following_url":"https://api.github.com/users/greggman/following{/other_user}","gists_url":"https://api.github.com/users/greggman/gists{/gist_id}","starred_url":"https://api.github.com/users/greggman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greggman/subscriptions","organizations_url":"https://api.github.com/users/greggman/orgs","repos_url":"https://api.github.com/users/greggman/repos","events_url":"https://api.github.com/users/greggman/events{/privacy}","received_events_url":"https://api.github.com/users/greggman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-13T23:18:42Z","updated_at":"2015-10-14T03:27:01Z","closed_at":"2015-10-14T03:27:01Z","body":"Sorry if this is a noob question\r\n\r\nI'm just trying to make a simple editor. The html/body is set to 100% height, There's a toolbar div on top set to 20% height and an editor div on bottom set to 80% height. Inside the editor div I insert a CodeMirror (or rather I pass the editor div into CodeMirror and CodeMirror inserts itself)\r\n\r\nBut, if the window is tall CodeMirror does not stretch to fit its container.\r\n\r\n![gif](http://i.imgur.com/1WSVLZ2.gif)\r\n\r\n    Green = top area\r\n    Blue = container for editor (editor should fill this minus 1em padding, bottom is too large)\r\n\r\nIf the window is too short  CodeMirror grows larger than its container or something strange happens when scrolling to the bottom. You can see\r\n\r\n![gif](http://i.imgur.com/FG5TOYx.gif)\r\n\r\n    Green = top area\r\n    Blue = container for editor\r\n    Red = body (should never see red given that top is 20% and editor is 80%)\r\n\r\nThe docs say set `.CodeMirror` to the size I want it but no matter what I set it to it seems to be ignored\r\n\r\nHere's a CodePen: http://codepen.io/greggman/pen/LpjwKp\r\n\r\nHow I can I get CodeMirror to just match the size of its container? \r\n"}}