fix: only stop event propagation in MkEmoji and MkCustomEmoji when menu prop is passed
This commit is contained in:
parent
83df1c0128
commit
19cba1a12a
|
@ -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}:`,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue