mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 13:33:08 +02:00
chore: improve reaction picker behaviour
This commit is contained in:
parent
af280f52ab
commit
cbcbd6f0a9
2 changed files with 10 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<MkModal ref="modal" :manual-showing="manualShowing" :src="src" @click="$refs.modal.close()" @opening="$refs.picker.focus()" @close="$emit('close')" @closed="$emit('closed')">
|
<MkModal ref="modal" :manual-showing="manualShowing" :src="src" @click="$refs.modal.close()" @opening="opening" @close="$emit('close')" @closed="$emit('closed')">
|
||||||
<MkEmojiPicker :show-pinned="showPinned" :as-reaction-picker="asReactionPicker" @chosen="chosen" ref="picker"/>
|
<MkEmojiPicker :show-pinned="showPinned" :as-reaction-picker="asReactionPicker" @chosen="chosen" ref="picker"/>
|
||||||
</MkModal>
|
</MkModal>
|
||||||
</template>
|
</template>
|
||||||
|
@ -46,6 +46,11 @@ export default defineComponent({
|
||||||
this.$emit('done', emoji);
|
this.$emit('done', emoji);
|
||||||
this.$refs.modal.close();
|
this.$refs.modal.close();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
opening() {
|
||||||
|
this.$refs.picker.reset();
|
||||||
|
this.$refs.picker.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -282,6 +282,10 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
reset() {
|
||||||
|
this.$refs.emojis.scrollTop = 0;
|
||||||
|
},
|
||||||
|
|
||||||
getKey(emoji: any) {
|
getKey(emoji: any) {
|
||||||
return typeof emoji === 'string' ? emoji : (emoji.char || `:${emoji.name}:`);
|
return typeof emoji === 'string' ? emoji : (emoji.char || `:${emoji.name}:`);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue