Nishant Dixit Nishant Dixit - 10 days ago 7
Javascript Question

Not able to type text after emoji(span)

I am working on chat app(cordova) in which I am facing problem in this code when i am going to type text after emoji i am not able to type

https://output.jsbin.com/radaref



<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/embed.js/4.1.3/embed.min.css" rel="stylesheet" />
</head>
<body>
<p contenteditable="true">This is a paragraph. It is editable. Try to change this text.<span class="emoticon emoticon-blush" title=":blush:"> </span></p>
<script src="https://cdn.jsdelivr.net/embed.js/4.1.3/embed.min.js"> </script>
</body>
</html>




Answer

See how its work just add &nbsp; after emoji

<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/embed.js/4.1.3/embed.min.css"  rel="stylesheet" />
</head>
<body>
<p contenteditable="true">This is a paragraph. It is editable. Try to  change this text.<span class="emoticon emoticon-blush" title=":blush:">  </span>&nbsp; </p>
<script src="https://cdn.jsdelivr.net/embed.js/4.1.3/embed.min.js">     </script>
</body>
</html>