From cbcbd6f0a910ee286b0eee491588d278190f341f Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 28 Feb 2021 10:03:52 +0900 Subject: [PATCH] chore: improve reaction picker behaviour --- src/client/components/emoji-picker-dialog.vue | 7 ++++++- src/client/components/emoji-picker.vue | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/client/components/emoji-picker-dialog.vue b/src/client/components/emoji-picker-dialog.vue index 3450d219c3..4b165d9f91 100644 --- a/src/client/components/emoji-picker-dialog.vue +++ b/src/client/components/emoji-picker-dialog.vue @@ -1,5 +1,5 @@ @@ -46,6 +46,11 @@ export default defineComponent({ this.$emit('done', emoji); this.$refs.modal.close(); }, + + opening() { + this.$refs.picker.reset(); + this.$refs.picker.focus(); + } } }); diff --git a/src/client/components/emoji-picker.vue b/src/client/components/emoji-picker.vue index 41e667dd98..7c82211993 100644 --- a/src/client/components/emoji-picker.vue +++ b/src/client/components/emoji-picker.vue @@ -282,6 +282,10 @@ export default defineComponent({ } }, + reset() { + this.$refs.emojis.scrollTop = 0; + }, + getKey(emoji: any) { return typeof emoji === 'string' ? emoji : (emoji.char || `:${emoji.name}:`); },