Keep selected card in view when opening preview
Opening the preview panel narrows .grid-area and reflows the auto-fill grid to fewer columns, moving the clicked card to a new row. The single-frame scrollIntoView ran while the browser's scroll-anchoring re-adjusted scrollTop mid-reflow, so the card scrolled out of view. Disable scroll anchoring on .grid-area (overflow-anchor:none) and defer the scroll by two animation frames against the settled layout, centring the card (block:'center'). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d82a0d6004
commit
7c1c2b390d
3 files changed
+8
-2
No files matched your search
+1
-1
@@ -197,7 +197,7 @@
|
||||
.filter-clear:hover { border-color: var(--danger); color: var(--danger); }
|
||||
|
||||
/* Grid */
|
||||
.grid-area { flex: 1; overflow-y: auto; padding: 24px; min-width: 0; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
|
||||
.grid-area { flex: 1; overflow-y: auto; overflow-anchor: none; padding: 24px; min-width: 0; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
|
||||
.grid-area::-webkit-scrollbar { width: 4px; }
|
||||
.grid-area::-webkit-scrollbar-track { background: transparent; }
|
||||
.grid-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
|
||||
|
||||
Reference in new issue
Block a user