jmadler / emoji-picker

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

Emoji on div contentEditable directly instead of input field? #95

Open Esinel opened 6 years ago

Esinel commented 6 years ago

Is there a way of attaching emoji plugin on div contentEditable directly instead of input field?

sean-macfarlane commented 6 years ago

I found from reading the source code that if you set this wysiwyg: false in options you it gives you a more bare bones usage of the plugin that you can use directly on a div contentEditable. If you look in the file /lib/js/jquery.emojiarea.js you'll see. You might have to edit some of the code in that file for the object EmojiArea_Plain for it to work the way you want though; that's what I had to do to use this the way I wanted.

Example:

emojiPicker = new EmojiPicker({
    emojiable_selector: '[data-emojiable=true]',
    assetsPath: '/resources/lib/emoji-picker/lib/img/',
    popupButtonClasses: 'fa fa-smile-o',
    wysiwyg: false
});
lukaszenkooo commented 6 years ago

Haha

lukaszenkooo commented 6 years ago

I znowu buhaha