Search code examples
javascripttinymce-4codemirror

Control cursor onload on tinymce/codemirror


I have a codemirror editor and tinymce editor side by side. When I load the page, cursor automatically comes at the tinymce editor. How can I prevent this?

EDIT

tinymce.init({
           selector: "#mytextarea",
           theme: "modern",
           plugins: ['ice code table contextmenu'],
           contextmenu: "align_element | add_callouts add_ref add_refitems",
           visual: false,
           toolbar1:'bold,italic,|,search,replace,code,|,ice_toggleshowchanges,iceacceptall,icerejectall,iceaccept,icereject,|,alignleft,aligncenter,alignright,|,table'
})

Solution

  • Are you loading the auto_focus plugin?

    https://www.tinymce.com/docs/configure/integration-and-setup/#auto_focus

    If you don't load that the editor does not grab focus on page load in my testing.