Emitted events not passed to child

Issue #665. So make sure wrapper messages don't emit MessageEmits. More info here: https://github.com/vuejs/rfcs/discussions/397.
This commit is contained in:
N-Pex 2025-07-15 12:10:35 +02:00
parent 33c6e7cb64
commit 0194339102
8 changed files with 27 additions and 28 deletions

View file

@ -2,7 +2,8 @@
<component
:is="rootComponent"
ref="root"
v-bind="{ ...$props, ...$attrs }">
v-bind="{ ...$props, ...$attrs }"
>
<div class="bubble image-bubble" ref="imageRef">
<ImageWithProgress v-if="attachment"
:aspect-ratio="16 / 9"
@ -26,7 +27,7 @@ import MessageOutgoing from "./MessageOutgoing.vue";
import ImageWithProgress from "../../ImageWithProgress.vue";
import { useLazyLoad } from "./useLazyLoad";
import { useI18n } from "vue-i18n";
import { MessageEmits, MessageProps, useMessage } from "./useMessage";
import { MessageProps, useMessage } from "./useMessage";
import { EventAttachment } from "../../../models/eventAttachment";
import { useDisplay } from "vuetify";
import utils from "@/plugins/utils";
@ -39,7 +40,6 @@ type RootType = InstanceType<typeof MessageOutgoing | typeof MessageIncoming>
const rootRef = useTemplateRef<RootType>("root");
const imageRef = useTemplateRef("imageRef");
const emits = defineEmits<MessageEmits>();
const props = defineProps<MessageProps>();
const cover = ref(true);
@ -56,7 +56,7 @@ const {
event,
isIncoming,
attachment,
} = useMessage($matrix, t, props, emits, undefined);
} = useMessage($matrix, t, props, undefined, undefined);
const rootComponent = computed(() => {
return isIncoming.value ? MessageIncoming : MessageOutgoing;