You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in case anyone would find this useful, as I do not have time for putting it into PR, but I seemed to have resolved most issues I had when using this inside a svelte component (except category click is sometimes not working, but most of time it does)
it shouldn't be too much work to put this into emoji-mart-svelte package
EmojiMart.svelte:
<script>
import { Picker } from"emoji-mart";import { onMount, createEventDispatcher, onDestroy } from"svelte";let emojiPickerEl;let picker;let mounted =false;constdispatch=createEventDispatcher();onMount(() => { picker =newPicker({ theme:"light", autoFocus:true,onClickOutside: () => {if (mounted) dispatch("close"); },onEmojiSelect: (emoji) => {dispatch("select", emoji); }, });emojiPickerEl.appendChild(picker);setTimeout(() => {// ensure click outside works mounted =true; }, 1); });onDestroy(() => {// the clickoutside handler is not unregistered properly, so this is probably redundant picker =null; emojiPickerEl =null; });
</script>
<divon:click|preventDefault|stopPropagationbind:this={emojiPickerEl} />
in case anyone would find this useful, as I do not have time for putting it into PR, but I seemed to have resolved most issues I had when using this inside a svelte component (except category click is sometimes not working, but most of time it does)
it shouldn't be too much work to put this into
emoji-mart-svelte
packageEmojiMart.svelte:
usage:
The text was updated successfully, but these errors were encountered: