This commit is contained in:
tamaina 2023-08-04 12:48:11 +00:00
parent 8a3dbc1c99
commit c73ec73920
1 changed files with 3 additions and 11 deletions

View File

@ -12,11 +12,10 @@ SPDX-License-Identifier: AGPL-3.0-only
:transparentBg="true"
:manualShowing="manualShowing"
:src="src"
@click="click"
@click="modal?.close()"
@opening="opening"
@close="emit('close')"
@closed="emit('closed')"
@hide="emit('hide')"
>
<MkEmojiPicker
ref="picker"
@ -37,7 +36,7 @@ import MkModal from '@/components/MkModal.vue';
import MkEmojiPicker from '@/components/MkEmojiPicker.vue';
import { defaultStore } from '@/store';
const props = withDefaults(defineProps<{
withDefaults(defineProps<{
manualShowing?: boolean | null;
src?: HTMLElement;
showPinned?: boolean;
@ -52,8 +51,6 @@ const emit = defineEmits<{
(ev: 'done', v: any): void;
(ev: 'close'): void;
(ev: 'closed'): void;
(ev: 'bgclick'): void;
(ev: 'hide'): void;
}>();
const modal = shallowRef<InstanceType<typeof MkModal>>();
@ -61,7 +58,7 @@ const picker = shallowRef<InstanceType<typeof MkEmojiPicker>>();
function chosen(emoji: any) {
emit('done', emoji);
if (props.manualShowing === null) modal.value?.close();
modal.value?.close();
}
function opening() {
@ -73,11 +70,6 @@ function opening() {
picker.value?.focus();
}, 10);
}
function click() {
emit('bgclick');
if (props.manualShowing === null) modal.value?.close();
}
</script>
<style lang="scss" module>