click link to header in rendered markdown description -> scroll to wrong height
When you click on the link button next to a header in rendered markdown in an issue or MR description, under most circumstances the page will scroll to a height that partially or fully obscures the header you scrolled to.
To reproduce:
For an issue:
- Create an issue (it's likely best to create a new throwaway one for this to ensure the right conditions are met)
- In the issue description, add a few paragraphs of nonsense, then an H2. Make sure that the H2 will be above the fold when you are scrolled to the top of the page while viewing the issue, but it has a few paragraphs above it.
- Add some more paragraphs of nonsense, then another H2. Make sure that this H2 will be below the fold when you are scrolled to the top of the page while viewing the issue.
- Save the issue.
- Scroll to the top of the page (if necessary), then click the link next to your first H2 in the description.
- expected: scroll up and the entire H2 is visible
- actual: the page scrolls, but the sticky header for the issue appears mid-scroll, and it obscures the H2
- Scroll down a bit so that your second H2 header is visible. Click the link icon button to scroll it to the top.
- expected: it scrolls to the top of the visible area and is not obscured
- actual: it works this time
For an MR:
- Follow steps 1 through 4 above for an MR description. You can just copy and paste the same text.
- Click on your first H2
- expected: it scrolls to the top of the visible area and is not obscured
- actual: it scrolls to the top of the visible area and becomes partially obscured
- Repeat the same thing for the other H2 further down the page
- expected: it scrolls to the top of the visible area and is not obscured
- actual: this time, the same thing happens that happened with the other H2 on this page. it is partially obscured.