Fix not render emoji in filter dropdown

This commit is contained in:
Hiroyuki Sato 2018-11-15 20:27:35 +09:00
parent 7528b2d260
commit 428b220a1f
2 changed files with 12 additions and 4 deletions

View file

@ -69,10 +69,13 @@ export default class DropdownEmoji extends FilteredSearchDropdown {
// Replace empty gl-emoji tag to real content
const dropdownItems = [...this.dropdown.querySelectorAll('.filter-dropdown-item')];
dropdownItems.forEach(dropdownItem => {
const name = dropdownItem.querySelector('.js-data-value').innerText;
const emojiTag = this.glEmojiTag(name);
const emojiElement = dropdownItem.querySelector('gl-emoji');
emojiElement.outerHTML = emojiTag;
const valueElement = dropdownItem.querySelector('.js-data-value');
if (valueElement !== null) {
const name = valueElement.innerText;
const emojiTag = this.glEmojiTag(name);
const emojiElement = dropdownItem.querySelector('gl-emoji');
emojiElement.outerHTML = emojiTag;
}
});
}

View file

@ -0,0 +1,5 @@
---
title: Fix not render emoji in filter dropdown
merge_request: 23112
author: Hiroyuki Sato
type: fixed