From 3c6c07843e5831dfabffeec0948961ba55093274 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Sun, 20 Sep 2026 17:41:23 +0100 Subject: [PATCH] fix(web): keep viewport after file delete --- web/src/main.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/main.ts b/web/src/main.ts index 55ef644..485d3bd 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -5341,7 +5341,12 @@ function seriesMain(tvDeck: TvReleasesView, views: HideableView[]): SeriesView { setStatus(null); void loadMetadata(id, ticket); if (focusKey !== null) { - view.querySelector(`[data-focus-id="${focusKey}"]`)?.focus(); + // A file delete rebuilds the season tree and moves focus to the control + // that replaced the delete action. Keep keyboard context without making + // the browser scroll the freshly repainted page back to that control. + view.querySelector(`[data-focus-id="${focusKey}"]`)?.focus({ + preventScroll: true, + }); focusKey = null; } }