1

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.

user8025
  • 99
  • 1
  • 9

1 Answers1

1

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

Community
  • 1
  • 1
BobbyTables
  • 4,008
  • 1
  • 27
  • 35