delowardev / vue3-emoji-picker

Simple and Powerful Emoji Picker for Vue3
https://codesandbox.io/p/github/delowardev/vue3-emoji-picker/main?file=%2FREADME.md
MIT License
171 stars 34 forks source link

vue3 Quiil editor problem #57

Open mark7651 opened 11 months ago

mark7651 commented 11 months ago

I'm trying to insert emoji into Quiil editor, but there is a error:

Failed to execute 'setStart' on 'Range': The offset 4294967295 is larger than the node's length (1).

Current code: onSelectEmoji(emoji) { if (this.editor) { const selection = this.editor.getSelection(); if (selection) { const lastIndex = selection.index || 0; const contentLength = this.editor.getLength(); console.log(contentLength); if (lastIndex >= 0 && lastIndex <= contentLength) { this.editor.insertText(lastIndex, emoji.i); this.editor.setSelection(lastIndex + emoji.u.length); } } this.toggleDialogEmoji(); } },

fabioselau077 commented 4 months ago

resolved?