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

Add support for emojis #118

Open
thibaudcolas opened this issue Dec 1, 2017 · 5 comments
Open

Add support for emojis #118

thibaudcolas opened this issue Dec 1, 2017 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@thibaudcolas
Copy link
Collaborator

thibaudcolas commented Dec 1, 2017

Feature. It should be easy to add emojis in text, in a cross-platform compatible, accessible way.

What is the current behavior?

The editor works in UTF-8, so emojis can be entered manually like any character.

What is the expected behavior?

There should be an emoji picker, and emojis should be annotated to make sure they are renderable in a site's front-end.

As of #171, it should now be possible to include the emoji picker of Draft.js Plugins: https://www.draft-js-plugins.com/plugin/emoji. I would really like to see this done in the Draftail demo site.

@thibaudcolas thibaudcolas added the enhancement New feature or request label Dec 1, 2017
@thibaudcolas thibaudcolas added this to the Nice to have milestone Dec 1, 2017
@thibaudcolas thibaudcolas modified the milestones: v1.1.0, Nice to have Feb 5, 2019
@thibaudcolas thibaudcolas modified the milestones: Nice to have, v1.3.0 Mar 4, 2019
@thibaudcolas thibaudcolas added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 4, 2019
@thibaudcolas
Copy link
Collaborator Author

This is now somewhat easier thanks to #171. #192 contains an example.

Draft.js seems to have issues with emojis that will need to be addressed: facebookarchive/draft-js#1105, facebookarchive/draft-js#1969.

@thibaudcolas thibaudcolas removed the good first issue Good for newcomers label Aug 14, 2019
@thibaudcolas thibaudcolas modified the milestones: v1.3.0, Nice to have Aug 14, 2019
@michael-yin
Copy link

@thibaudcolas

I already used draftail in my project and now I want to add emoji and mention feature to the editor.

I did some tests on https://demo.draftail.org/storybook/?path=/story/plugins--emoji and below are some problems I found.

EmojiSelect

The popup window did not work well on mobile devices.

I have no idea is it easy to change the order of buttons in toolbar, so we can put emoji at first and this can make things better.

Another way is to use some SCSS (media query?) to solve this problem.

EmojiSuggestions

Can not do auto refresh, you can test by typing :smile

Arrow key seems not working in popup

If I use Mention plugin to reference some people, then the emoji suggest feature is not working any more.

Thx.

@mrolafsson
Copy link

mrolafsson commented Oct 14, 2019

Re:

Arrow key seems not working in popup

Is it possible that keyBindingFn is no longer working for plugins? I've defined a simple one that works except that one doesn't seem to fire.

@fridaystreet
Copy link

I have both of these plugins working together, they don't use keyBindingsFn they use the onChange hook.

In regards to display of the select box, you can replace the popover component with your own. Just copy the popover component out of the plugin, modify it how you want, and pass your own into the EmojiSelect props.

We use material-ui and so used a as we also wanted to anchor the box above our chat message input and be displayed above it. Couldn't find a nice way to do that using the positionSuggestions stuff in the plugin, so we just don't use that.

@ramibch
Copy link

ramibch commented Jun 9, 2022

@michael-yin

Michael, thank you for the demo. Do you have the source code of that? I need to add that to my RichtTextField in the admin interface and I dont know how.

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants