hackmd-io-issues icon indicating copy to clipboard operation
hackmd-io-issues copied to clipboard

Browser always jumps back to last anchor link on any click in document (Safari only?)

Open Jammersplit opened this issue 3 years ago • 0 comments

Is this a hackmd.io issue?

  • [X] Yes, the bug happens on https://hackmd.io
  • [ ] No. If it's a self-hosted CodiMD instance, please fire up the issue in the repo of CodiMD: https://github.com/hackmdio/codimd

What's the problem

Current behaviour

When I jump in a document to a heading link (from the TOC or an anchor hash added to URL) and then scroll away from that position, it always jumps back to this anchor whenever I click anywhere else in the document.

This seems to happen only in Safari, on mobile and desktop. At least I tested it only in Chrome and Safari.

Provide steps to reproduce:

  1. Open a HackMD document in Safari.
  2. Click on an internal link, like from the table of contents, to jump there.
  3. Scroll away from the link target.
  4. Click anywhere like on the document background and it jumps back to the last anchor link.

Expected behaviour

Nothing should happen when I click in this case.

Environment

I use HackMD on:

Desktop

  • OS: macOS
  • Browser: Safari
  • Browser Version: 14.1.2

Mobile

  • Device: iPhone
  • OS: iOS 15.5
  • Browser: Safari

Jammersplit avatar Jun 14 '22 14:06 Jammersplit