fix(frontend): モバイルレイアウト時にホームを押しても最上部へスクロールされない

Fix #15679
This commit is contained in:
syuilo 2025-03-20 08:35:45 +09:00
parent b37622fa64
commit acac759d87
1 changed files with 7 additions and 1 deletions

View File

@ -56,12 +56,18 @@ import { deepMerge } from '@/utility/merge.js';
import { miLocalStorage } from '@/local-storage.js';
import { availableBasicTimelines, hasWithReplies, isAvailableBasicTimeline, isBasicTimeline, basicTimelineIconClass } from '@/timelines.js';
import { prefer } from '@/preferences.js';
import { useRouter } from '@/router.js';
provide('shouldOmitHeaderTitle', true);
const tlComponent = useTemplateRef('tlComponent');
const rootEl = useTemplateRef('rootEl');
const router = useRouter();
router.useListener('same', () => {
top();
});
type TimelinePageSrc = BasicTimelineType | `list:${string}`;
const queue = ref(0);
@ -128,7 +134,7 @@ function queueUpdated(q: number): void {
}
function top(): void {
if (rootEl.value) scroll(rootEl.value, { top: 0 });
if (rootEl.value) scroll(rootEl.value, { top: 0, behavior: 'smooth' });
}
async function chooseList(ev: MouseEvent): Promise<void> {