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

fix flickering when clicking on activity anchor

Jonas Jabari71340391a3b4
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 b0b1cf60ab9..e6735e9e386 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
@@ -430,7 +430,17 @@ export default class IndexController extends Controller {
event.preventDefault();
const activityId = event.params.id;
- this.scrollToActivity(activityId);
+ // not using the scrollToActivity method here as it is causing flickering issues
+ // in case of a setAnchor click, we can go for a direct scroll approach
+ const scrollableContainer = this.getScrollableContainer();
+ const activityElement = document.getElementById(`activity-anchor-${activityId}`);
+
+ if (scrollableContainer && activityElement) {
+ scrollableContainer.scrollTo({
+ top: activityElement.offsetTop - 90,
+ behavior: 'smooth',
+ });
+ }
window.location.hash = `#activity-${activityId}`;
}