Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue3 Quiil editor problem #57

Open
mark7651 opened this issue Aug 4, 2023 · 1 comment
Open

vue3 Quiil editor problem #57

mark7651 opened this issue Aug 4, 2023 · 1 comment

Comments

@mark7651
Copy link

mark7651 commented Aug 4, 2023

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
Copy link

resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants