I have a situation in which I need to place the focus/cursor
at the end of text that is loaded inside the Froala editor. I have tried it with focus event of Froala (events.focus
), but does not worked.
Why I need it to place at the end is that, while Floara editor is loaded on page there will be so data in it, without clicking on the editor sector users need to type their data on it as its continuation. So tried the focus code, but failed.
Is it possible to place the cursor at the end of all data in Froala Editor?
I'm added my codes here: FIDDLE
See https://jsfiddle.net/tx1xhxfn/11/. It should be like this:
var editor = $('#edit').data('froala.editor');
editor.selection.setAtEnd(editor.$el.get(0));
editor.selection.restore();