Skip to content

Resolve "Clicking on comment anchor link twice is broken in Firefox"

What does this MR do?

This MR fixes a bug where clicking on a note anchor twice would lead to a partly hidden note in Firefox (as described #19132 (closed)). It looks like this was caused by Firefox calling handleLocationHash earlier than other browsers (e.g. Chrome) causing our workaround there to be useless. Delaying the call to window.scrollBy seems to fix this.

Note that this sometimes causes a short "flash", as the affected note is first hidden behind the header and then reappears as the position is adjusted (see screencast below). This happens already in Chrome etc. (where clicking twice works as well) so I guess it's necessary here.

Screenshots

Screencast

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Closes #19132 (closed)

Edited by Jan Beckmann

Merge request reports