Skip to content

Fix scroll jump when opening task subtasks - #9

Merged
snktshrma merged 1 commit into
mainfrom
cursor/fix-subtask-scroll-0037
Jun 19, 2026
Merged

Fix scroll jump when opening task subtasks#9
snktshrma merged 1 commit into
mainfrom
cursor/fix-subtask-scroll-0037

Conversation

@Tanops

@Tanops Tanops commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Problem

When expanding subtasks on the gantt timeline or interacting with subtasks in the task detail sheet, the page/modal would jump back to the top.

Root cause

  1. Gantt timeline (desktop): Vertical scroll lives on the window, but scroll preservation only tracked .gscroll (which is horizontal-only on default desktop layouts). Re-renders after expanding subtasks restored scrollTop on the wrong element.
  2. Detail modal: openDetail() rebuilt the modal DOM without saving/restoring .tbox scroll position, so edits to subtasks (toggle done, change owner, etc.) reset the modal to the top.

Fix

  • Capture and restore window.scrollY alongside gantt scroll on every renderGantt() call.
  • Save and restore .tbox scroll when openDetail() refreshes the same task (e.g. after subtask edits). Drilling into a different subtask still starts at the top of the new view.

Testing

  • npm test — all 37 tests pass
Open in Web Open in Cursor 

- Restore window.scrollY after gantt re-renders on desktop layouts where
  vertical scroll lives on the page, not inside .gscroll
- Restore detail modal (.tbox) scroll when refreshing the same task after
  subtask edits (toggle done, change owner/size, etc.)

Co-authored-by: Tanops <Tanops@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-19 09:23 UTC

@snktshrma
snktshrma merged commit 3ec08df into main Jun 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants