fix(cookbook): scroll serve panel into view when expanded (#1180) (#1191)

This commit is contained in:
Zarl-prog
2026-06-02 19:51:35 +05:30
committed by GitHub
parent f667667da3
commit b89141679f
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -650,9 +650,10 @@ function _rerenderCachedModels() {
item.classList.add('doclib-card-expanded');
item.style.flexDirection = 'column';
item.style.alignItems = 'stretch';
if (list) list.scrollTop = 0;
item.insertAdjacentHTML('beforeend', panelHtml);
const panel = item.querySelector('.hwfit-serve-panel');
// Scroll the serve panel into view within its nearest scrollable ancestor
requestAnimationFrame(() => panel.scrollIntoView({ block: 'nearest', behavior: 'smooth' }));
// Build command preview
function updateCmd() {