fix chat scroll inside scroll
Deploy app frontend / app frontend (push) Successful in 1m43s

This commit is contained in:
2024-12-07 01:33:10 +02:00
parent 14e7dec5b4
commit 7d611b6916
7 changed files with 120 additions and 106 deletions
+17 -4
View File
@@ -1,8 +1,11 @@
<template>
<div class="grid h-full sm:grid-rows-[auto_1fr_auto] grid-rows-[1fr_auto_auto] overflow-hidden">
<div class="flex overflow-auto pb-safe-or-4 sm:pt-safe w-full px-4 touch-pan-y">
<div class="sm:max-w-prose grid grid-cols-1 mx-auto my-5">
<slot />
<div
class="flex overflow-auto pb-safe-or-4 sm:pt-safe px-4 touch-pan-y"
ref="contentScrollContainer"
>
<div class="sm:max-w-prose grid grid-cols-1 mx-auto my-5 w-full">
<slot name="default" v-bind:scrollToBottom />
</div>
</div>
@@ -25,11 +28,21 @@
</template>
<script setup lang="ts">
import { useTemplateRef } from 'vue'
const slots = defineSlots<{
default?: () => void
default?: (slotBindings: { scrollToBottom: typeof scrollToBottom }) => void
footer?: () => void
}>()
const contentScrollContainerRef = useTemplateRef('contentScrollContainer')
const scrollToBottom = () => {
if (contentScrollContainerRef.value) {
contentScrollContainerRef.value.scrollTop = contentScrollContainerRef.value.scrollHeight
}
}
const layoutPageHead = useHead({
htmlAttrs: { class: 'overflow-hidden' },
bodyAttrs: { class: 'overflow-hidden' },