MacDownApp / MacDownApp/macdown

Scrolling bug, jumps to top if code block contains comment

Open
#1,268 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rich Text Format
Stars
9.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hi, I have found a reproducible markdown file that causes this weird scrolling issue. See attached md file.
You must ensure, the MacDown window is shorter than the distance between the two code blocks. The bug seems only to appear if both elements are not shown at the same time (-> make the window extra small during testing).

Also, if you remove the `# INJECT` comment, the bug will not appear. Here is a video:

https://user-images.githubusercontent.com/1321720/133909711-f24d545a-fbba-4729-8e5b-8eb0d2630b98.mov

Test file:
[test-case.md](https://github.com/MacDownApp/macdown/files/7190706/test-case.md)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open test-case.md in MacDown and reproduce the jump with the window shorter than the distance between the code blocks. Start by tracing the editor's scrolling behavior when the # INJECT comment is present, then verify that scrolling remains stable for the supplied case and that removing the comment still does not regress behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, objective-c
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.