1
0

fix: reply screen on mobile scroll to empty space (#616)

Co-authored-by: Joel Drake <joel.drake@ica.se>
This commit is contained in:
Joel Drake 2022-12-30 17:38:46 +01:00 committed by GitHub
parent 78a1981d87
commit 6a5383b595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ definePageMeta({
const route = useRoute()
const id = $(computedEager(() => route.params.status as string))
const main = ref<ComponentPublicInstance | null>(null)
let bottomSpace = $ref(0)
const publishWidget = ref()
const { data: status, pending, refresh: refreshStatus } = useAsyncData(
@ -28,8 +28,6 @@ function scrollTo() {
if (!statusElement)
return
const statusRect = statusElement.getBoundingClientRect()
bottomSpace = window.innerHeight - statusRect.height
statusElement.scrollIntoView(true)
}
@ -59,7 +57,7 @@ onReactivated(() => {
<template>
<MainContent back>
<template v-if="!pending">
<div v-if="status" min-h-100vh mt--1px>
<div v-if="status" mt--1px>
<template v-for="comment of context?.ancestors" :key="comment.id">
<StatusCard
:status="comment" :actions="comment.visibility !== 'direct'" context="account"
@ -89,8 +87,6 @@ onReactivated(() => {
:older="context?.descendants[di + 1]" :newer="context?.descendants[di - 1]" :has-newer="di === 0" :main="status"
/>
</template>
<div :style="{ height: `${bottomSpace}px` }" />
</div>
<StatusNotFound v-else :account="$route.params.account" :status="id" />