joeattardi / picmo

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

Wrong position for first time in createPopup #259

Closed Mizan-Rifat closed 1 year ago

Mizan-Rifat commented 1 year ago

When I click on my picker for the first time the popup appears at the left 0 position but after that it works fine. See my attachments... Screenshot 2023-01-31 at 4 38 26 PM Screenshot 2023-01-31 at 4 38 36 PM

joeattardi commented 1 year ago

Can you share a code sample that shows how you are opening the picker?

Mizan-Rifat commented 1 year ago

Here is my integration:


     const btn = document.querySelector('.emoji-btn');
     const picker = window.picmoPopup.createPopup(
        {},
        {
          referenceElement: btn,
          triggerElement: btn,
          position: 'bottom-start',
          showCloseButton: false
        }
      );
      btn.addEventListener('click', () => {
        picker.toggle();
      });`
joeattardi commented 1 year ago

Thank you! I see the issue now, I forgot to update the popup picker to accommodate the prefixed classes!

Once I made that change the positioning should work as expected, can you give the just-released 5.7.4 a try?

Thanks.