Can CodeMirror be appended to an iframe?

The case is, when I append codemirror to an iframe node, with codemirror.css inserted into the iframe in advance, all the view part seems to work good, but input doesn’t work well. sometimes I can’t input anything, seems like keyboard event can not be caught. when I changed iframe back to div , all works well.
Is there any way to append codemirror to an iframe?

Here is my code. After you double-click the input area, you can’t input anything.

It currently can’t, because it assumes that the window and document objects in its global scope are the context in which it is running. You can load the library into an iframe, and use it there, but you can’t load the library in the parent frame, and put the editor in an iframe.

This is likely to change with version 6, but I am not sure when I’ll have time to work on that.

thanks ,It helps me.
CodeMirror is wonderful , thanks for your work.