Fix emoji autocomplete (#1616)

* Fix emoji autocomplete

* Feedback review
This commit is contained in:
Elias Nahum 2018-04-25 13:40:03 -03:00 committed by GitHub
parent ac6e5fda79
commit 252ea21f8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,9 +82,9 @@ export default class EmojiSuggestion extends Component {
return;
}
if (this.props.emojis !== nextProps.emojis) {
if (this.matchTerm.length) {
this.handleFuzzySearch(this.matchTerm, nextProps);
} else if (!this.matchTerm.length) {
} else {
const initialEmojis = [...nextProps.emojis];
initialEmojis.splice(0, 300);
const data = initialEmojis.sort();