fix: preserve scroll position in cached grid views

display:none discards scrollTop in WebKitGTK, so navigating away
from album/artist/genre grids and back reset scroll to top.

Replace inline style.display toggling with a CSS class that uses
visibility:hidden + height:0 + overflow:hidden. This collapses
the element visually while keeping the DOM alive with its scroll
state intact. contain:strict on hidden views ensures zero layout
cost while collapsed.
This commit is contained in:
2026-03-15 09:11:36 -04:00
parent 199c91013f
commit 54df917ffd
2 changed files with 17 additions and 5 deletions
+11
View File
@@ -152,3 +152,14 @@ body div.sidebar {
height: 100%;
contain: layout style paint;
}
/* Hidden cached views: use visibility+size collapse instead of
display:none so scroll containers preserve their scrollTop.
display:none discards scroll state in WebKitGTK. */
.main-panel > .view-hidden {
visibility: hidden !important;
height: 0 !important;
overflow: hidden !important;
pointer-events: none !important;
contain: strict !important;
}