jdecked / twemoji

Emoji for everyone.
https://jdecked.github.io/twemoji/v/latest/preview-svg.html
MIT License
937 stars 59 forks source link

How to use twemoji for input field #620 #45

Open vindhya124 opened 1 year ago

vindhya124 commented 1 year ago

Twemoji works for fields like span and h1 tags but how can we use to replace the emoji 14.0 in input field.

Appreciate your help in advance.

Thanks

jdecked commented 1 year ago

It's substantially more complicated a problem than it first appears. Check out either draft-js or its newer sibling Lexical, both by Facebook – the problem is, emoji can contain multiple codepoints and you need to figure out how to position the cursor appropriately so it appears seamless to the user. Both of those libraries help you do that and replacing emoji are used as examples in their docs.