user8025
user8025

Reputation: 99

Linkify in Textarea Jquery

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

Answers (1)

BobbyTables
BobbyTables

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

Related Questions