Search code examples
quill

How to get the last index of quill editor?


I want to use the insertEmbed method of the quill editor to insert stuff at the end of the content inside the quill editor. So what I need to do, is find the last index of the quill editor so I can do lastIndex + 1 for the first parameter:

insertEmbed(index: Number, type: String, value: any, source: String = 'api')

Which should insert what I want at the very end of the content.

I've searched the docs and the only thing I see similar to what I want is getLines.

Any suggestions?


Solution

  • Add this as the index:

    quill.scroll.length()