I need access to the current cursor position in the q-editor.
I also looked at this thread:
https://forum.quasar-framework.org/topic/4702/how-to-get-the-cursor-position-form-q-input/5
But the above link only works for q-input
The following code returns cursorPos: undefined on the console.
<q-editor v-model="text" ref="editorval" @input="changeInput"/>
and
changeInput(value) {
let editor = this.$refs.editorval
if (editor) {
this.cursorPosition = editor.selectionStart;
console.log('cursorPos:', this.cursorPosition)
}
this.cursorPosition = 0;
}
What is the correct way to do this?