mervick / emojionearea

Emoji Picker Plugin for jQuery
https://jsfiddle.net/mervick/1v03Lqnu/765/
MIT License
954 stars 258 forks source link

Emoji categories break after search #255

Open skgith1 opened 6 years ago

skgith1 commented 6 years ago

After performing a text search the emoji categories break down and do not operate properly (a lot of emoji categories become missing from the picker).

Steps to reproduce: 1) Click the emoji button to open the picker 2) Type a search term such as "apple" 3) Click anywhere outside the picker (the picker will close) 4) Open the picker again to see the missing emojis

The search text box will be cleared at this point and the picker can be restored to proper operation by typing some other text and then hitting backspace until all text is deleted.

skgith1 commented 6 years ago

Also, I have noticed a similar issue occurs when highlighting the text you type in the search box and pressing delete.

johnsenpeder commented 5 years ago

Similar issue to this is the anchors break too, seems to always happen if you search for something, click an anchor.. If you then remove all text and try click any anchor, it will not scroll to the right sections. And randomly happens after searching even if not clicking any of the anchors.

maxencehenneron commented 5 years ago

Same issue, searching and closing the picker breaks the categories completely

HanPrower commented 5 years ago

This might not be the "correct" fix as far as how the plugin is meant to work, but I got it working by changing https://github.com/mervick/emojionearea/blob/99129f789f2e7619ce553c038783a13f47cbc846/dist/emojionearea.js#L1357 to:

categoryBlocks.filter('[data-tone="' + tones.find("i.active").data("skin") + '"]:not([name="recent"])').children().show();

jerryliu1997 commented 5 years ago

Has this bug been fixed?

carpii commented 5 years ago

@HanFox could you submit a pull request? The bug still exists but I believe your fix is correct

carpii commented 5 years ago

@mervick, why do you thumb-down my reply? You don't think it's the correct solution?