You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following this #636 where I'm trying to migrate from emoji-mart v3
I'm trying to show an emoji based on its native version. I can't seem to figure how to get the skintone.
If I use <em-emoji /> directly, it always print the no-skin-tone version (or skin = 1). I guess this is because you have to explicitly provide the skin to it. <em-emoji set="apple" native={"💑🏿"} /> // Will output "💑"
If I use SearchIndex, it won't return the skin (whereas getEmojiDataFromNative used to do this)
We have this function that we use to get the skin tone out of a native emoji:
exportconstgetEmojiSkinTone=(emoji: string): number|null=>{// your editor may not render these, but they are skin tone modifiers// (copy and paste them into your browser to see)constskinTones=['','🏻','🏼','🏽','🏾','🏿'];letskin=null;skinTones.forEach(skinTone=>{if(emoji.indexOf(skinTone)>0){skin=skinTones.indexOf(skinTone)+1;}});returnskin||1;};
Hi,
Following this #636 where I'm trying to migrate from emoji-mart v3
I'm trying to show an emoji based on its native version. I can't seem to figure how to get the skintone.
If I use
<em-emoji />
directly, it always print the no-skin-tone version (or skin = 1). I guess this is because you have to explicitly provide the skin to it.<em-emoji set="apple" native={"💑🏿"} />
// Will output "💑"If I use
SearchIndex
, it won't return the skin (whereasgetEmojiDataFromNative
used to do this)Will output
Which does not tell me which skin was my native emoji.
The text was updated successfully, but these errors were encountered: