Reputation: 99
I am using linkify in textarea & i have autosave function in it.
After every 3 secs the text is saved in database
.I am calling linkify before saving in database
.
$(".froala-element").linkify();
What problem i am facing is the focus of cursor/caret is lost due to linkify ..
I keep on writing and after autosave cursor is lost its position.. I am using froala-editor as my text editor.
Upvotes: 1
Views: 554
Reputation: 4705
You can store the caret position before you run the linkify/db-save, and then restore the caret position after its done. An example of how to store and restore caret positions is provided here:
Persisting the changes of range objects after selection in HTML
Upvotes: 1