When I double-click the ‘Insert Emoji into text’ string in the IDE, the selection is shifted two characters to the right, on both the left and right sides. If I remove the emoji face, the double-clicking highlights correctly. This happens on macOS, but might happen on other platforms.
Did you stop mid message there?
No, I typed it all in OK and it looked fine in Preview, but on clicking Reply it missed the emoji down. So I edited the bottom again and clicked OK and it lost it again!
Me.ToolbarAddButton(“InsertEmoji”, “Emoji face goes here”, “Insert Emoji into text”)
If any others have this issue too, I’ll add a Feedback report.
Not seeing this for High Sierra. Or you make a video about what you did.
What you’ve run into is the forum doesn’t accept all emojis and they just kinda break the post
Also, I see this behavior with how Dash does snippets. Dash sticks a light bulb emoji in where the caret is supposed to end up, and sometimes the insertion point ends up wrong. I would bet it’s related to the emoji as you’re seeing.
[quote=456788:@David Cox]Me.ToolbarAddButton(“InsertEmoji”, “Emoji face goes here”, “Insert Emoji into text”)
If any others have this issue too, I’ll add a Feedback report.[/quote]
We use Graphics.StringWidth when measuring where the selection highlight should go. My off-the-cuff guess is that the Emoji actually consists of two or three characters when we do that, but displays as only one.
Interestingly I have found a work around. In the IDE, with the line
Me.ToolbarAddButton("InsertEmoji", "Emoji face goes here", "Insert Emoji into text")
if I double-click on the word ‘Insert’ and drag right, the highlight is shifted. if I double-click on the word ‘here’ and drag left, the highlight is correct.