This evening I just ran into the problem of this problem.
Several other posts consider the visibility of the textarea parent as important, if it's hidden, you might run into this problem.
In my situation, the form itself and the immediate environment were great, but the problem with the Backbone view manager up the rendering chain was a problem.
My view element does not fit into the DOM until the view is fully completed, so I think that the element that does not contain the DOM is considered hidden or simply not processed.
To get around this, I added a post-rendering phase (pseudo-code):
view.render(); $('body').html(view.el); view.postRender();
In postRender, the view can do what it needs, knowing that all the content is now visible on the screen, this is where I moved CodeMirror and worked fine.
This can also be explained by why you might run into problems with things like pop-ups, as in some cases they might try to create all the content before displaying it.
Hope this helps someone.
Toby
Toby Skinner Jun 21 '13 at 23:55 2013-06-21 23:55
source share