fix(web): keep viewport after file delete
ci / web (push) Successful in 1m39s
e2e / e2e (push) Failing after 2m41s
ci / rust (push) Successful in 5m41s
ci / image (push) Successful in 9m0s

This commit is contained in:
Miguel Palhas
2026-09-20 17:41:23 +01:00
parent 77ac295bdf
commit 3c6c07843e
+6 -1
View File
@@ -5341,7 +5341,12 @@ function seriesMain(tvDeck: TvReleasesView, views: HideableView[]): SeriesView {
setStatus(null);
void loadMetadata(id, ticket);
if (focusKey !== null) {
view.querySelector<HTMLElement>(`[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<HTMLElement>(`[data-focus-id="${focusKey}"]`)?.focus({
preventScroll: true,
});
focusKey = null;
}
}