Hi, i have 2 main issue facing while using CKEditor
1) i want to set cursor position at last of text content and i m using bello code.
/// PopUpEditor is my editor instance
var htmltext = "I want to set cusor position at end of this string";
CKEDITOR.instances.PopUpEditor.insertHtml(htmltext);
var range = CKEDITOR.instances.PopUpEditor.createRange();
range.moveToPosition(range.root, CKEDITOR.POSITION_BEFORE_END);
CKEDITOR.instances.PopUpEditor.getSelection().selectRanges([range]);
CKEDITOR.instances.PopUpEditor.focus();
On trying 1-2 time it set cursor position at last line, showing in like img1.png and on start typing it start on below line like showing in img2.png
2) after 2-3 time set focusing it show error on browser console(ErrorOnBrowser.png) and clear text inside editor.
Please let me know where i am missing code