-
Notifications
You must be signed in to change notification settings - Fork 20
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
$editor.insertText doesn't work without focus #43
Comments
@tre-dev |
Hm, that could be. Here is a rough example.
|
Maybe it's possible to get the current/last cursor position and then insert the Text at that position? Code below is adding an emoji like this but at an incorrect position
|
@tre-dev If it's not what's you want, look at this issue ianstormtaylor/slate#3412. I use the final solution and you can try others. |
The example you wrote worked! Thanks! Magic code was this:
PS: FYI, I actually prefer this emoji-picker https://github.com/serebrov/emoji-mart-vue |
I'm trying to add emojis via emoji-picker programmatically via
this.$editor.insertText(emoji)
.But it only works once or twice after I add the focus manually, afterwards the focus is gone and emojis can't be added unless I add focus manually again. Adding focus programmatically doesn't work as it resets the cursor position.
The text was updated successfully, but these errors were encountered: