From 73853b08f583043ba05c9bf44f0a6ee4ec4d1df4 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 8 Sep 2025 22:53:17 +0900 Subject: [PATCH] use cqh --- packages/frontend/src/pages/qr.read.vue | 28 +------------------------ packages/frontend/src/pages/qr.show.vue | 28 ++----------------------- 2 files changed, 3 insertions(+), 53 deletions(-) diff --git a/packages/frontend/src/pages/qr.read.vue b/packages/frontend/src/pages/qr.read.vue index 3a2e00d63a..028248d4ff 100644 --- a/packages/frontend/src/pages/qr.read.vue +++ b/packages/frontend/src/pages/qr.read.vue @@ -8,8 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only ref="rootEl" :class="$style.root" :style="{ - '--MI-QrReadScrollHeight': scrollContainer ? `${scrollHeight}px` : `calc( 100dvh - var(--MI-minBottomSpacing) )`, - '--MI-QrReadViewHeight': 'calc(var(--MI-QrReadScrollHeight) - var(--MI-stickyTop, 0px) - var(--MI-stickyBottom, 0px))', + '--MI-QrReadViewHeight': 'calc(100cqh - var(--MI-stickyTop, 0px) - var(--MI-stickyBottom, 0px))', '--MI-QrReadVideoHeight': 'min(calc(var(--MI-QrReadViewHeight) * 0.3), 512px)', }" > @@ -82,9 +81,6 @@ const rootEl = ref(null); const videoEl = ref(null); const overlayEl = ref(null); -const scrollContainer = shallowRef(null); -const scrollHeight = ref(window.innerHeight); - const scannerInstance = shallowRef(null); const tab = ref<'users' | 'notes' | 'all'>('users'); @@ -335,28 +331,6 @@ onUnmounted(() => { scannerInstance.value?.destroy(); }); - -//#region scroll height -function checkScrollHeight() { - scrollHeight.value = scrollContainer.value ? scrollContainer.value.clientHeight : window.innerHeight; -} - -let ro: ResizeObserver | undefined; - -onMounted(() => { - scrollContainer.value = getScrollContainer(rootEl.value); - checkScrollHeight(); - - if (scrollContainer.value) { - ro = new ResizeObserver(checkScrollHeight); - ro.observe(scrollContainer.value); - } -}); - -onUnmounted(() => { - ro?.disconnect(); -}); -//#endregion