Events
The EmojiButton
class emits the following events:
emoji
Fired when an emoji is selected. The callback will receive a single object with one or more of the following properties:
custom
: This will betrue
for a custom emoji.emoji
: The Unicode emoji character that was selected. This will be included for native and Twemoji emojis, but not for custom emojis.name
: The name of the emoji that was selected.url
: The URL of the emoji image. This will be included for Twemoji and custom emojis.
const picker = new EmojiButton();
picker.on('emoji', selection => {
alert(`"emoji" event fired, emoji is ${selection.emoji} with name ${selection.name}`);
});
hidden
Fired when the picker is hidden.
const picker = new EmojiButton();
picker.on('hidden', () => {
alert('"hidden" event fired');
});