V-Emoji-Picker icon indicating copy to clipboard operation
V-Emoji-Picker copied to clipboard

Can't clear the search input and currentCatogory would not reset to 'Peoples' when closing the emoji picker

Open bwliu62 opened this issue 2 years ago • 2 comments

Hi, I am a student and learning to use your wonderful package. I tried my best to figure out how to implement the above two features, but can't succeed. Is it possible to add these functions to your package? really appreciate!

I tried to in 'data' add currentCategory: "Peoples" and filterEmoji: "", but it doesn't work.

bwliu62 avatar Aug 25 '21 04:08 bwliu62

any tips could implement them?

bwliu62 avatar Aug 25 '21 04:08 bwliu62

@bwliu62 A bit of a long way around to get the job done, but should work until something better comes along.

const picker = this.$refs.picker as VEmojiPicker;
const cateories = picker.$children.find((component: Vue) => component.$el.id === 'Categories') as Categories;
const input = picker.$children.find((component: Vue) => component.$el.id === 'InputSearch') as InputSearch;
const peoplesCategory = cateories.$children.find((component: Vue) => {
  const propsData = component.$options.propsData as {label: string};
  return propsData?.label === 'Peoples';
}) as Vue;
const peoplesSvg = peoplesCategory.$el as HTMLElement;

peoplesSvg.click();
input.inputSearch = '';

d42ohpaz avatar Feb 14 '22 05:02 d42ohpaz