I am using the ace editor component from ajax.org inside a jquery tab interface. Each tab will contain a separate ace editor. Whenever I switch to a new tab, the editor in it won't get the focus.
I can detect when a tab is selected by binding to the "tabsshow" event of jquery UI. Does any one know how to set focus to the editor in it if say the id of my editor div is editor-tab-0 for the first tab, and so on...?
Please can some one help?
editor.focus(); //To focus the ace editor var n = editor.getSession().getValue().split("\n").length; // To count total no. of lines editor.gotoLine(n); //Go to end of document
To focus to the end:
editor.focus(); editor.navigateFileEnd();
Thanks to @a-user
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With