From e498f67203ce58fdcbf6958276c25c5bb37d50ee Mon Sep 17 00:00:00 2001 From: jjabari-op <122434454+jjabari-op@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:21:21 +0100 Subject: [PATCH] Bug/59281 split screen activity tab does not scroll to the right position from list view (#17210) https://community.openproject.org/work_packages/59281 --- .../work-packages/activities-tab/index.controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts index cf2cc74fa9b..c3a7cd3a307 100644 --- a/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/index.controller.ts @@ -398,7 +398,7 @@ export default class IndexController extends Controller { } private getScrollableContainer():HTMLElement | null { - if (this.isWithinNotificationCenter()) { + if (this.isWithinNotificationCenter() || this.isWithinSplitScreen()) { // valid for both mobile and desktop return document.querySelector('.work-package-details-tab') as HTMLElement; } @@ -419,6 +419,10 @@ export default class IndexController extends Controller { return window.location.pathname.includes(this.notificationCenterPathNameValue); } + private isWithinSplitScreen():boolean { + return window.location.pathname.includes('work_packages/details'); + } + private addEventListenersToCkEditorInstance() { this.onSubmitBound = () => { void this.onSubmit(); }; this.adjustMarginBound = () => { void this.adjustJournalContainerMargin(); };