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

[#43311] (Mobile) Clicking on notification row does not scroll to activity

Dombi Attilaff8a761b67d2
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
index 6f598ec372d..0f4a451b30b 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
@@ -73,6 +73,8 @@ export class ActivityPanelBaseController extends UntilDestroyedMixin implements
private initialized = false;
+ private comingFromNotifications = false;
+
constructor(
readonly apiV3Service:ApiV3Service,
readonly I18n:I18nService,
@@ -86,6 +88,12 @@ export class ActivityPanelBaseController extends UntilDestroyedMixin implements
this.reverse = wpActivity.isReversed;
this.togglerText = this.text.commentsOnly;
+
+ const lastTransitionName = uiRouterGlobals.successfulTransitions.peekTail().from().name as string;
+
+ if (/^notifications/.test(lastTransitionName)) {
+ this.comingFromNotifications = true;
+ }
}
ngOnInit():void {
@@ -189,6 +197,11 @@ export class ActivityPanelBaseController extends UntilDestroyedMixin implements
const scrollOffset = notificationElement.offsetTop - (scrollContainer as HTMLElement).offsetTop - this.additionalScrollMargin;
scrollContainer.scrollTop = scrollOffset;
+
+ // Make sure the scrollContainer is visible on mobile
+ if (this.comingFromNotifications) {
+ scrollContainer.scrollIntoView(true);
+ }
}
public toggleComments():void {