diff --git a/src/components/Chat.vue b/src/components/Chat.vue index 133caa5..0396bad 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -1740,10 +1740,17 @@ export default { showContextMenuForEvent(e) { const event = e.event; - this.selectedEvent = event; - this.updateRecentEmojis(); - this.showContextMenu = !this.showContextMenu; - this.showContextMenuAnchor = e.anchor; + if (this.selectedEvent == event) { + this.showContextMenu = !this.showContextMenu; + } else { + this.showContextMenu = false; + this.$nextTick(() => { + this.selectedEvent = event; + this.updateRecentEmojis(); + this.showContextMenu = true; + this.showContextMenuAnchor = e.anchor; + }) + } }, showAvatarMenuForEvent(e) { @@ -1761,6 +1768,7 @@ export default { if (this.showContextMenu) { this.showContextMenu = false; this.showContextMenuAnchor = null; + this.selectedEvent = null; e.preventDefault(); } },