Scroll dashboard content to top on change
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled

This commit is contained in:
jelveh
2026-04-24 23:18:50 -07:00
parent 205a8bbbc5
commit 2449c3f385
+6
View File
@@ -374,6 +374,9 @@ async function UIDashboard (options) {
document.querySelector('.dashboard-content').classList.add(tab);
}
// Scroll content area to top
$el_window.find('.dashboard-content').scrollTop(0);
// If files tab with path, navigate without adding to history
if ( tab === 'files' && filePath ) {
const filesTab = tabs.find(t => t.id === 'files');
@@ -416,6 +419,9 @@ async function UIDashboard (options) {
history.replaceState(null, '', newHash ? `#${newHash}` : window.location.pathname);
}
// Scroll content area to top
$el_window.find('.dashboard-content').scrollTop(0);
// Close sidebar on mobile after selection
$el_window.find('.dashboard-sidebar').removeClass('open');
$el_window.find('.dashboard-sidebar-toggle').removeClass('open');