Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Reset scroll position on angular transitions for mobile

Henriette Dinger37354cfeddd6
diff --git a/frontend/src/app/modules/router/openproject.routes.ts b/frontend/src/app/modules/router/openproject.routes.ts
index 296692115d5..c39294af67b 100644
--- a/frontend/src/app/modules/router/openproject.routes.ts
+++ b/frontend/src/app/modules/router/openproject.routes.ts
@@ -144,6 +144,9 @@ export function initializeUiRouterListeners(injector:Injector) {
if (transition.from().data && _.get(state, 'data.menuItem') !== transition.from().data.menuItem) {
updateMenuItem(_.get(state, 'data.menuItem'), 'add');
}
+
+ // Reset scroll position, mostly relevant for mobile
+ window.scrollTo(0, 0);
});
$transitions.onExit({}, function(transition:Transition, state:StateDeclaration) {