diff --git a/.eslintrc.json b/.eslintrc.json index d348401..a5e849b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -20,7 +20,8 @@ "storeToRefs": true, "useNuxtApp": true, "NodeJS": true, - "useHeadSafe": true + "useHeadSafe": true, + "defineEmits": true }, "parser": "vue-eslint-parser", "parserOptions": { diff --git a/components/EmojiPicker.vue b/components/EmojiPicker.vue index 21443c7..107ca5f 100755 --- a/components/EmojiPicker.vue +++ b/components/EmojiPicker.vue @@ -2,9 +2,6 @@ import emojiJson from '~/assets/json/emoji.json'; export default { - props: { - opened: Boolean, - }, emits: ['picked-emoji'], data() { return { @@ -22,7 +19,9 @@ export default { }; }, methods: { - emojiStyles(emojiShortName: string, width: number) { + emojiStyles(emojiShortName: string | undefined, width: number) { + if (!emojiShortName) return; + const emojis = emojiJson; const emoji = emojis.find((e) => e.short_names[0] === emojiShortName); if (!emoji) return; @@ -38,17 +37,17 @@ export default { }; }, scrollTo(categoryName: string) { - const emojiPane = document.getElementById('emojiPane'); + const emojiPane = (this.$refs.emojiPane as HTMLDivElement); const category = document.getElementById(categoryName); if (!emojiPane || !category) return; - emojiPane.scrollTop = category.offsetTop - 96; + emojiPane.scrollTop = category.offsetTop - 550; } } };