Skip to content

[FIX] emoji picker exception#6709

Merged
engelgabriel merged 7 commits into
RocketChat:developfrom
gdelavald:fix-emoji-picker-exception
Apr 18, 2017
Merged

[FIX] emoji picker exception#6709
engelgabriel merged 7 commits into
RocketChat:developfrom
gdelavald:fix-emoji-picker-exception

Conversation

@gdelavald

Copy link
Copy Markdown
Contributor

@RocketChat/core

Closes #6636

This changes are intended to fix the exception that was happening when changing the Emoji Picker filter text, which was caused by some race conditions with Blaze computations and the jquery used to clear the emoji picker window for the dynamic categories (recent and rocket).

I aimed at removing the jquery code that was a fix for the duplication bug for these categories, which was being caused by some bad structure on the UI. The fix I found was to add a new reactive variable as a flag, so whenever we need to update the dynamic categories, the flag would be set as true and the UI would react properly (see emojiPicker.js:268 and emojiPicker.js:282).

I noticed a small change that could improve the performance of the Emoji Picker rendering, because we were adding all the emojis to the categories, even when we didn't show those categories, and this would happen again every time we changed categories. Now the emojiList only renders the emojis for the selected category (see emojiList.js:132), let me know if this is not something we want (since the html would be incomplete).

The major change is on the emojiList.js updateRecent function, where we no longer return an html, but only trigger structural changes and let the UI update reactively. Although we have to check if there is an active instance, since this changes can be triggered when removing custom emojis from the admin panel.

This is my first time touching some of this stuff, so feedback here is much appreciated.

@rodrigok

Copy link
Copy Markdown
Member

It's working perfectly on my local machine

@engelgabriel engelgabriel merged commit 0e9ef6f into RocketChat:develop Apr 18, 2017
rodrigok pushed a commit that referenced this pull request Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when filtering emoji picker list

4 participants