Page randomly jumps to the issue/MR comment anchor

Summary

If you visit a link to an issue/MR comment, then the page will jump to that comment on load. The problem is if you scroll away from the comment, the page will randomly jump back to it.

Steps to reproduce

  1. Visit a link to an issue/MR comment
  2. Scroll down to the new comment textbox
  3. Add a new comment
  4. Notice that the first window will jump back to the comment.

Screencap

20230628-test-rejumping-to-comment

What is the current bug behavior?

The browser jumps to the comment long after page load.

What is the expected correct behavior?

The browser does not jump to the comment long after page load.

Possible fixes

Edited by Michael Kozono