Skip to content

Commit 87caba6

Browse files
committed
fix: bind:this のライフサイクル依存によるスクロール未定義バグを querySelector を用いた根本的解決に修正
1 parent efdc117 commit 87caba6

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

src/views/MobileCompanion.svelte

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,14 @@
293293
requestThumbnailsForGames(visibleThumbnailGames);
294294
}
295295
296-
const getContentContainer = () => contentContainer;
297-
298-
const resetScrollToTop = () => {
296+
$: if (activeView === "detail") {
297+
selectedGameId;
299298
void tick().then(() => {
300-
const container = getContentContainer();
299+
const container = document.querySelector(".content");
301300
if (container) {
302301
container.scrollTop = 0;
303302
}
304303
});
305-
};
306-
307-
$: if (activeView === "detail") {
308-
selectedGameId;
309-
resetScrollToTop();
310304
}
311305
312306
const isObject = (value: unknown): value is Record<string, unknown> =>

0 commit comments

Comments
 (0)