emoji-mart icon indicating copy to clipboard operation
emoji-mart copied to clipboard

"Frequently used" is broken if `init` function is called first

Open srmagura opened this issue 2 years ago • 1 comments

Repro Steps

  1. yarn build and yarn dev in the emoji-mart repository. The homepage will show the emoji picker with the Frequently Used section visible.
  2. Now add the line EmojiMart.init({ data }) to the beginning of the JavaScript code in the example. Exact location where the line of code should be added
  3. Refresh the page and the Frequently Used section will disappear from the picker.

Why it happens

I looked in the code and found that FrequentlyUsed.get() is only called in the _init function. This seems wrong to me...

As always, let me know if you want a PR. Thank you.

srmagura avatar Jul 28 '22 16:07 srmagura

Here's a hacktacular workaround that we will be using until this bug can be fixed properly: https://github.com/missive/emoji-mart/compare/main...spotxyz:emoji-mart:frequently-used-hack?expand=1

srmagura avatar Jul 29 '22 13:07 srmagura