This is working fine in Firefox and IE, but I can’t get this to work in Chrome:
self.editorIframeDocument.body.focus()
editorIframeDocument == contentDocument || contentWindow.document depending on the browser.
.body.focus() makes it so when the editor loads I can start typing right away. Perfect, however, in Chrome it’s not working. I tried hooking into the iframe as well as the iframe #document but no go.
I saw some hacks with setting a selection and removing it, but they were all examples in a <div> contenteditable with specific HTML inside not an <iframe> which could have anything from nothing to large amounts of text.
No jQuery.
The problem was that the editor wasn’t loaded yet so Chrome wouldn’t let me focus on it. Checking for ready state fixed the issue: