fix: only stop event propagation in MkEmoji and MkCustomEmoji when menu prop is passed

This commit is contained in:
tess 2024-05-06 23:59:42 +02:00
parent 83df1c0128
commit 19cba1a12a
2 changed files with 4 additions and 2 deletions

View file

@ -85,6 +85,7 @@ const errored = ref(url.value == null);
function onClick(ev: MouseEvent) { function onClick(ev: MouseEvent) {
if (props.menu) { if (props.menu) {
ev.stopPropagation();
os.popupMenu([{ os.popupMenu([{
type: 'label', type: 'label',
text: `:${props.name}:`, text: `:${props.name}:`,

View file

@ -4,8 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<img v-if="!useOsNativeEmojis" :class="$style.root" :src="url" :alt="props.emoji" decoding="async" @pointerenter="computeTitle" @click="onClick" v-on:click.stop/> <img v-if="!useOsNativeEmojis" :class="$style.root" :src="url" :alt="props.emoji" decoding="async" @pointerenter="computeTitle" @click="onClick"/>
<span v-else :alt="props.emoji" @pointerenter="computeTitle" @click="onClick" v-on:click.stop>{{ colorizedNativeEmoji }}</span> <span v-else :alt="props.emoji" @pointerenter="computeTitle" @click="onClick">{{ colorizedNativeEmoji }}</span>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -39,6 +39,7 @@ function computeTitle(event: PointerEvent): void {
function onClick(ev: MouseEvent) { function onClick(ev: MouseEvent) {
if (props.menu) { if (props.menu) {
ev.stopPropagation();
os.popupMenu([{ os.popupMenu([{
type: 'label', type: 'label',
text: props.emoji, text: props.emoji,