Fill a div with the editor

How can the codemirror editor be configured to fill its parent div at all times? The div is managed by other code.
When I create the editor just specifying the div as the parent, the editor size ends up being 0*0.
I feel that this is a common problem, but could not find a solution here.

That’s not something I’ve ever seen. Regular CSS sizing rules apply to the editor, so if you style .cm-editor to fill its parent, it will.

I never saw the documentation style the editor for positioning and thought that the library took care of that. Using ‘width: 100%’ and ‘height: 100%’ on cm-editor did make it appear, but all I see is a scrollable plane that can not be edited or focused. I am using basicSetup and javascript extensions on creation.
Sorry if I am missing something obvious

You’ll also need to put overflow: auto on .cm-scroller to make the editor handle its own scroll bar, but other than that this should ‘just work’. See this example.

The issue was a style conflict with codemirror and a compiler I use. Resolving it made codemirror ‘just work’ without any additional styling.