vue-quill-editor
vue-quill-editor copied to clipboard
Move cursor to the final
Hi, how can I use the Quill Api ? I need to use the focus method of the editor so cursor goes to the final of the line.
You can use setSelection
this.$refs.input.quill.setSelection(this.content.length, 0);
@damsltc57 thanks for the response but it doesnt work either. This is my code, when ever add new content from a select box, cursor goes back to the begining of line.
onItemClick (response) { this.content = this.removeHtmlTags(this.content) + this.removeHtmlTags(response) this.$refs.editor.quill.update() this.showOptionsContainer = false this.$refs.editor.quill.setSelection(this.content.length, 0) }
It work for me
setTimeout(() => { this.$refs.input[0].quill.setSelection(this.content.length, 0); }, 0);