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

Co-authored-by: Joel Drake <joel.drake@ica.se>
zio/stable
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
1 changed files with 2 additions and 6 deletions

View File

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