fix: Switch to opacity: 0 for composer emoji.

This seems to be the best option for displaying emoji in the composer. While it means selected emoji don't actually have the selection colour applied, it's the most functional of all the options. Facebook uses the same approach.
This commit is contained in:
Aviral Dasgupta 2016-08-03 18:27:49 +05:30
parent b7555f49ea
commit 8e66e6dfdd

View file

@ -98,7 +98,7 @@ function unicodeToEmojiUri(str) {
return str; return str;
} }
// Unused for now, due to https://github.com/facebook/draft-js/issues/414 // Workaround for https://github.com/facebook/draft-js/issues/414
let emojiDecorator = { let emojiDecorator = {
strategy: (contentBlock, callback) => { strategy: (contentBlock, callback) => {
findWithRegex(EMOJI_REGEX, contentBlock, callback); findWithRegex(EMOJI_REGEX, contentBlock, callback);
@ -115,7 +115,7 @@ let emojiDecorator = {
backgroundPosition: 'center center', backgroundPosition: 'center center',
overflow: 'hidden', overflow: 'hidden',
}; };
return (<span title={shortname} style={style}><span style={{color: 'transparent'}}>{props.children}</span></span>); return (<span title={shortname} style={style}><span style={{opacity: 0}}>{props.children}</span></span>);
}, },
}; };