Mismatch in entityRanges with emoji as presiding text to mentions

241 views Asked by At

i am using mentions plugin it works awesome as expected without emojis/unicode.

My situations

ex: " dude Suresh Chandrababu" is my text in editor. Suresh Chandrababu is mention.

I need to extract the mention offset position, length and send to my API, problem here is when emojis/unicode added before the mentions, offset returned by Draft editor was wrong.

Expected o/p: entityRange - offset:3, length: 18 Actual o/p: entityRange - offset:2, length: 18

Emoji's length is 2, but entityRange consider it as 1.

How to handle this situation.

o/p:enter image description here

0

There are 0 answers