1
0
Files
pawkey-sk/packages/frontend/src/components/MkPostFormDialog.vue
T
かっこかり bbe404a0b2 fix(frontend): 投稿フォームがオーバーフローした際にスクロールできるように (#15571)
* fix(frontend): 投稿フォームがオーバーフローした際にスクロールできるように

* Update Changelog

* remove unused props
2025-03-03 08:17:20 +00:00

65 lines
1.2 KiB
Vue

<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<MkModal
ref="modal"
:preferType="'dialog'"
@click="modal?.close()"
@closed="onModalClosed()"
@esc="modal?.close()"
>
<MkPostForm
ref="form"
:class="$style.form"
v-bind="props"
autofocus
freezeAfterPosted
@posted="onPosted"
@cancel="modal?.close()"
@esc="modal?.close()"
/>
</MkModal>
</template>
<script lang="ts" setup>
import { shallowRef } from 'vue';
import MkModal from '@/components/MkModal.vue';
import MkPostForm from '@/components/MkPostForm.vue';
import type { PostFormProps } from '@/types/post-form.js';
const props = withDefaults(defineProps<PostFormProps & {
instant?: boolean;
fixed?: boolean;
autofocus?: boolean;
}>(), {
initialLocalOnly: undefined,
});
const emit = defineEmits<{
(ev: 'closed'): void;
}>();
const modal = shallowRef<InstanceType<typeof MkModal>>();
const form = shallowRef<InstanceType<typeof MkPostForm>>();
function onPosted() {
modal.value?.close({
useSendAnimation: true,
});
}
function onModalClosed() {
emit('closed');
}
</script>
<style lang="scss" module>
.form {
max-height: 100%;
margin: 0 auto auto auto;
}
</style>