When the Picker is open and you're hovering of custom emojis, the following error appears in the console (albeit not blocking any important functions).
TypeError: emojiData.short_names is undefined
The stack trace leads to the "preview" component, which I am hiding with display: none because there is no other way to turn it off.
I believe this is because sanitize strips out short_names here:
Though don't quote me on that because I don't really understand that part of the code very well. All I can say is that this is how I insert custom emojis into the index:
// When emojis are loaded, I put them into the index by doing this (which
// is counter-intuitive but seems to do the job. You actually have to be careful
// to do it this way, because otherwise every search call would insert a new
// "Custom" category into the dataset
emojiIndex.search('', { custom: buildCustomEmojis(immutableListOfEmojisHere) });
// The original data of the emojis is "url" and "shortcode" (e.g. :octocat:), here is
// what buildCustomEmojis function does
export const buildCustomEmojis = customEmojis => {
const emojis = [];
customEmojis.forEach(emoji => {
const shortcode = emoji.get('shortcode');
const url = emoji.get('url');
const name = shortcode.replace(':', '');
emojis.push({
id: name,
name,
short_names: [name],
text: '',
emoticons: [],
keywords: [name],
imageUrl: url,
custom: true,
});
});
return emojis;
};
As you can see, short_names is clearly set on input. Not sure what happens after that.
When the Picker is open and you're hovering of custom emojis, the following error appears in the console (albeit not blocking any important functions).
The stack trace leads to the "preview" component, which I am hiding with
display: none
because there is no other way to turn it off.I believe this is because sanitize strips out short_names here:
https://github.com/missive/emoji-mart/blob/master/src/utils/index.js#L22-L31
Though don't quote me on that because I don't really understand that part of the code very well. All I can say is that this is how I insert custom emojis into the index:
As you can see, short_names is clearly set on input. Not sure what happens after that.