Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported emojis should render the shortcode #157

Closed
ajbeaven opened this issue Jan 9, 2018 · 3 comments
Closed

Unsupported emojis should render the shortcode #157

ajbeaven opened this issue Jan 9, 2018 · 3 comments

Comments

@ajbeaven
Copy link

ajbeaven commented Jan 9, 2018

I've found that 🤷 doesn't seem to render anything when using the messenger set:

<Emoji
    emoji={':shrug:'}
    sheetSize={32}
    size={32}
    set="messenger"
    backgroundImageFn={(() => require('../../../assets/img/emoji-messenger-32.png'))}
/>

Presumably this is because the messenger set doesn't support this emoji? In my opinion, it's better to render something rather than nothing. I'd suggest using the raw shortcode passed in to the emoji.

@savardc
Copy link

savardc commented Jan 9, 2018

We're also having this issue. I'm ok with rendering the shortname or maybe add a callback?

@EtienneLem
Copy link
Member

Went the callback way, as picker still requires unsupported emojis to be ignored. Here’s how you would render :shrug: when unsupported:

<Emoji
  set={'messenger'}
  emoji={'shrug'}
  size={24}
  fallback={(emoji) => {
    return `:${emoji.short_names[0]}:`
  }}
/>

I hope that’s good enough 😄

@ajbeaven
Copy link
Author

ajbeaven commented Jan 9, 2018

Woah, that was crazy fast. Thanks heaps!

ajbeaven added a commit to ajbeaven/emoji-mart that referenced this issue Jan 9, 2018
EtienneLem added a commit that referenced this issue Jan 15, 2018
Emoji fallback shouldn't apply styling #157
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

No branches or pull requests

3 participants