joeattardi / picmo

JavaScript emoji picker. Any app, any framework.
https://picmojs.com
MIT License
1.19k stars 117 forks source link

emoji:select event on popup #195

Closed levipadre closed 2 years ago

levipadre commented 2 years ago

Hi, thanks for the great plugin. I have some trouble since I updated from emoji-button. My problem is that I can't find a way to use picker.on('emoji:select', selection => { console.log('Selected emoji: ', selection.emoji); }); with popup. My code so far is working:

const button = document.querySelector('[data-emoji]'); 
const picker = new createPopup({
        theme: 'autoTheme',
    },{
        referenceElement: button,
        triggerElement: button
    });

but like this it says "Uncaught TypeError: picker.on is not a function". Any suggestion?

Thanks!

joeattardi commented 2 years ago

Hi, I may have missed this in the changelog but .on is now .addEventListener. I'll add this to the changelog if it's not already there.

levipadre commented 2 years ago

I may have missed, thanks for the advice.