jmadler / emoji-picker

Add a slick emoji selector to input fields and textareas on your website.
Other
1.31k stars 318 forks source link

Contents of textarea not clearning #62

Closed share-with-me closed 7 years ago

share-with-me commented 7 years ago

I am creating a chat application. Once the user submits the message through the form, the contents of textarea are not clearing. I have tried,

$('#inputMessage).val(' ').focus() once the send button is clicked by the user where inputMessage is the id of textarea that lets the user type in the message and where data-emojiable="true". Following is the screenshot of application. The user has typed in the message which is also broadcasted. However, the contents of the textarea are still the same. (not clearing!)

screen shot 2017-05-02 at 12 59 59 pm

Any inputs will be highly appreciated! Thanks!

share-with-me commented 7 years ago

Managed to achieve it. The class of the textarea dynamically changes to emoji-wysiwyg-editor. So all that was needed is $('.emoji-wysiwyg-editor').html(''); once the user sends the message. This clears out the textarea as soon as the message is sent. Closing the issue.