fix(web): keep viewport after file delete
This commit is contained in:
+6
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user