Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute emojionearea box on top of my own icon, not from default smile icon #435

Open
DannCarlo opened this issue May 18, 2021 · 7 comments

Comments

@DannCarlo
Copy link

I have an emoji icon from font awesome that I want to use as when I click it, the emojionearea plugin will bring the emoji box on top of it then I can use it to add emojis on my textarea, just like facebook messenger. How can I do that?

@bryan-farris
Copy link

bryan-farris commented Jun 2, 2021

I've been working on this for a bit now, hope it can help. Still a work in progress on my end but it's working so far:

// Init emojionearea
var emojiPicker = $('div.emojiinstance').emojioneArea({
   standalone: true,
   autocomplete: false,
});
// Assign var for the emojionearea instance
var emojionearea = emojiPicker[0].emojioneArea;
// Assign var for your btn
var emojiBtn = $('.your-trigger-el');
// Set up a click event to open the picker
emojiBtn.on('click', function(e) {
    e.preventDefault();
    emojioneArea.showPicker();
});

Edited to add comments and this note: you'll have to hide the default picker/icon with CSS.

@DannCarlo
Copy link
Author

I've been working on this for a bit now, hope it can help. Still a work in progress on my end but it's working so far:

// Init emojionearea
var emojiPicker = $('div.emojiinstance').emojioneArea({
   standalone: true,
   autocomplete: false,
});
// Assign var for the emojionearea instance
var emojionearea = emojiPicker[0].emojioneArea;
// Assign var for your btn
var emojiBtn = $('.your-trigger-el');
// Set up a click event to open the picker
emojiBtn.on('click', function(e) {
    e.preventDefault();
    emojioneArea.showPicker();
});

Edited to add comments and this note: you'll have to hide the default picker/icon with CSS.

Thank you so much sir! Will try later 😁

@DannCarlo
Copy link
Author

How can I place the chosen input to my textarea when I select an emoji from the picker?

@DannCarlo
Copy link
Author

And I want to it to show without the emojionecontainer, only the box containing emoji because this is what happens from your code sir
em

@DannCarlo
Copy link
Author

What I want to happen is when I click the icon, the blue smile face, the area where I can pick emoji will pop in top of it, hoping you can help me sir thanks!

@bryan-farris
Copy link

From my own usage and searching the open and closed issues here on the repo, it looks like CSS is the best way to go here. By that I mean, you'd hide the default emojionearea and button with CSS and then position the picker window when it opens with CSS. Hope this helps!

@DannCarlo
Copy link
Author

Hello sir, I will try thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants